.me-editor { position:relative; min-width:0; padding:36px 0 60px; color:var(--text); scroll-margin-top:104px; }
.me-editor [hidden] { display:none !important; }
.me-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:29px; }
.me-heading > div { min-width:0; }
.me-title-line { display:flex; align-items:flex-start; gap:14px; min-width:0; }
.me-heading-mark { display:inline-flex; flex:0 0 auto; align-items:center; justify-content:center; width:clamp(28px,3vw,36px); height:clamp(34px,3.7vw,43px); margin-top:4px; color:var(--text); }
.me-heading-mark > svg { display:block; width:100%; height:100%; }
.topic-page .me-editor h1 { margin:0; font-size:clamp(32px,3.7vw,44px); font-weight:730; line-height:1.18; letter-spacing:-.04em; }
.me-intro { max-width:650px; margin:14px 0 0; color:var(--muted); font-size:14px; line-height:1.75; }
.me-expand { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; padding:0; border:1px solid var(--line); border-radius:11px; background:var(--card); color:var(--muted); cursor:pointer; }
.me-workspace { display:grid; grid-template-columns:minmax(324px,.8fr) minmax(0,1.7fr); gap:22px; align-items:stretch; }
.me-controls { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto; gap:20px; min-width:0; min-height:0; padding:20px; border:1px solid var(--line); border-radius:18px; background:var(--card); }
.me-control { min-width:0; min-height:0; }
.me-control:nth-child(2) { overflow:auto; scrollbar-width:thin; scrollbar-color:color-mix(in srgb,var(--accent) 40%,transparent) transparent; }
.me-control.me-view-control { display:grid; grid-template-rows:auto minmax(0,1fr); overflow:hidden; container-type:inline-size; }
.me-view-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.me-view-heading > .me-label { margin:0; }
.me-view-control > .me-views { min-height:0; padding:2px; overflow:auto; align-content:start; scrollbar-width:thin; scrollbar-color:color-mix(in srgb,var(--accent) 40%,transparent) transparent; }
.me-editor .me-blank-download { display:inline-flex; align-items:center; justify-content:center; gap:7px; flex:none; min-height:36px; max-width:100%; margin:0; padding:8px 11px; border:1px solid color-mix(in srgb,var(--accent) 40%,var(--line)); border-radius:10px; background:color-mix(in srgb,var(--accent) 10%,var(--card)); color:var(--accent); box-shadow:inset 0 1px 0 #ffffff14; font:inherit; font-size:12px; font-weight:600; line-height:1.4; white-space:nowrap; cursor:pointer; transition:background .18s ease,border-color .18s ease,transform .18s ease; }
.me-blank-download > svg { flex:none; width:16px; height:16px; }
.me-blank-download:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (hover:hover) { .me-editor .me-blank-download:not(:disabled):hover { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 17%,var(--card)); } }
.me-editor .me-blank-download:not(:disabled):active { transform:translateY(1px); }
@container (max-width:200px) {
  .me-view-heading { flex-direction:column; align-items:stretch; }
  .me-editor .me-blank-download { width:100%; min-height:40px; padding:8px 6px; white-space:normal; }
  .me-blank-download > span { min-width:0; text-wrap:balance; }
}
.me-control + .me-control { margin-top:0; }
.me-control > label,.me-label { display:block; margin:0 0 9px; color:var(--text); font-size:13px; font-weight:600; line-height:1.5; }
.me-control select { display:block; width:100%; min-height:46px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--bg); color:var(--text); font:inherit; font-size:13px; line-height:1.5; cursor:pointer; }
.me-control select:disabled { opacity:.6; cursor:default; }
.me-picker { position:relative; min-width:0; }
.me-picker-trigger { display:flex; align-items:center; gap:8px; width:100%; min-height:46px; padding:10px 12px; border:1px solid var(--line); border-radius:11px; background:var(--bg); color:var(--text); text-align:left; cursor:pointer; }
.me-picker-trigger > :first-child { flex:1; min-width:0; font-size:13px; font-weight:550; }
.me-picker-model-name { display:flex; align-items:center; flex-wrap:wrap; column-gap:4px; row-gap:1px; min-width:0; }
.me-picker-model-prefix { flex:none; color:var(--text); font-weight:500; }
.me-picker-model-name .ds-mark { height:1.65em; max-width:100%; }
.me-picker-trigger > svg { flex:none; width:15px; height:15px; color:var(--muted); transition:transform .2s ease; }
.me-picker-trigger[aria-expanded="true"] > svg { transform:rotate(180deg); }
.me-picker-count { flex:none; padding:3px 6px; border-radius:5px; background:color-mix(in srgb,var(--accent) 10%,transparent); color:var(--accent); font-size:9px; font-weight:600; white-space:nowrap; }
.me-picker-panel { position:absolute; z-index:20; left:0; top:calc(100% + 7px); width:100%; margin:0; overflow:hidden; border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line)); border-radius:12px; background:var(--bg); box-shadow:0 12px 32px #16112928; }
.me-picker-search { display:flex; align-items:center; gap:8px; margin:9px; padding:0 9px; border:1px solid var(--line); border-radius:8px; color:var(--muted); }
.me-picker-search > svg { flex:none; width:16px; height:16px; }
.me-picker-search > input { display:block; min-width:0; width:100%; height:36px; padding:0; border:0; outline:0; background:transparent; color:var(--text); font:inherit; font-size:12px; }
.me-picker-search:focus-within { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 10%,transparent); }
.me-picker-options { max-height:min(265px,36dvh); overflow:auto; padding:3px 5px 6px; scrollbar-width:thin; scrollbar-color:color-mix(in srgb,var(--accent) 45%,transparent) transparent; }
.me-picker-option { display:flex; align-items:center; gap:10px; min-height:38px; padding:8px; border-radius:7px; color:var(--text); cursor:pointer; }
.me-picker-option > :first-child { flex:1; min-width:0; font-size:12px; line-height:1.5; }
.me-picker-option[data-active="true"] { background:color-mix(in srgb,var(--accent) 9%,transparent); }
.me-picker-option[aria-selected="true"] > :first-child { color:var(--accent); font-weight:600; }
.me-picker-option[aria-selected="true"] .me-picker-model-name { color:var(--text); font-weight:500; }
.me-picker-empty { margin:14px; color:var(--muted); font-size:12px; line-height:1.6; }
.me-views { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.me-view-card { position:relative; min-width:0; }
.me-view-card > .me-view { width:100%; height:100%; }
.me-view-download { position:absolute; z-index:1; top:3px; right:3px; display:grid; place-items:center; width:22px; height:22px; padding:0; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--accent); cursor:pointer; }
.me-view-download > svg { width:13px; height:13px; }
.me-view-download:disabled { opacity:.4; cursor:default; }
.me-view { position:relative; display:flex; flex-direction:column; align-items:center; gap:4px; min-width:0; padding:6px 5px; border:1px solid var(--line); border-radius:9px; background:var(--bg); color:var(--muted); font-size:10px; line-height:1.4; cursor:pointer; transition:border-color .18s ease,box-shadow .18s ease,background .18s ease; }
.me-view[aria-pressed="true"] { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 7%,var(--bg)); box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 20%,transparent); color:var(--text); }
.me-loading-view { opacity:.5; pointer-events:none; }
.me-loading-view i { display:block; width:26px; height:35px; border-radius:4px; background:var(--line); }
.me-view img { display:block; width:100%; height:35px; object-fit:contain; }
.me-view span { width:100%; overflow-wrap:anywhere; text-align:center; font-size:9px; }
.me-upload { position:relative; padding:16px 12px 11px; border:1px dashed color-mix(in srgb,var(--accent) 32%,var(--line)); border-radius:12px; background:color-mix(in srgb,var(--accent) 3%,var(--bg)); transition:border-color .18s ease,background .18s ease; }
.me-upload[data-dragging="true"] { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,var(--bg)); }
.me-file { position:absolute; inset:0; z-index:2; display:block; width:100%; height:100%; margin:0; padding:0; border:0; clip:auto; clip-path:none; opacity:0; cursor:pointer; }
.me-upload:focus-within { outline:2px solid var(--accent); outline-offset:4px; }
.me-upload-button { display:flex; flex-direction:column; align-items:center; gap:7px; margin:0; color:var(--text); font-size:13px; font-weight:550; line-height:1.5; pointer-events:none; }
.me-upload-button svg { color:var(--accent); }
.me-upload-button small { color:var(--muted); font-size:11px; font-weight:400; }
.me-upload p { margin:12px 0 0; color:var(--muted); font-size:10px; line-height:1.6; text-align:center; }
.me-editor .me-remove { display:inline-flex; align-items:center; justify-content:center; width:100%; margin-top:10px; padding:9px 12px; border:1px solid color-mix(in srgb,#d45d68 40%,var(--line)); border-radius:8px; background:color-mix(in srgb,#d45d68 7%,var(--bg)); color:#c94f5b; font:inherit; font-size:12px; font-weight:600; line-height:1.5; cursor:pointer; }
.me-image-tools { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; min-width:0; margin:0; padding:12px 14px; border:1px solid var(--line); border-radius:11px; background:var(--card); transform-origin:left center; }
.me-image-tools[data-active="false"] { opacity:.65; }
.me-image-tools > svg { flex:none; width:19px; height:19px; color:var(--accent); }
.me-image-setting { flex:1 1 85px; min-width:70px; }
.me-image-setting > label { display:flex; align-items:center; justify-content:space-between; gap:6px; color:var(--muted); font-size:10px; line-height:1.4; white-space:nowrap; }
.me-image-setting output { color:var(--text); font-size:11px; font-variant-numeric:tabular-nums; }
.me-image-tool-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.me-image-rotate,.me-edit-toggle { display:inline-flex; align-items:center; justify-content:center; flex:none; width:29px; height:32px; padding:0; border:1px solid var(--line); border-radius:7px; background:var(--bg); color:var(--text); cursor:pointer; }
.me-image-rotate > svg { width:15px; height:15px; }
.me-edit-toggle > svg { width:17px; height:17px; }
.me-edit-toggle[aria-pressed="true"] { border-color:color-mix(in srgb,var(--accent) 45%,var(--line)); background:color-mix(in srgb,var(--accent) 10%,var(--bg)); color:var(--accent); }
.me-image-tools button[aria-pressed="false"] { border-color:var(--line); background:color-mix(in srgb,var(--accent) 4%,var(--bg)); color:var(--accent); box-shadow:inset 0 1px 0 #ffffff0b; }
.me-image-tools button[aria-pressed="true"] { border-color:#a08cf5; background:#7762e6; color:#fff; box-shadow:0 2px 8px #7762e633,0 0 0 1px #9986f31a; }
.me-image-tools button[aria-pressed]:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media (hover:hover) {
  .me-image-tools button[aria-pressed="false"]:not(:disabled):hover { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 12%,var(--bg)); }
  .me-image-tools button[aria-pressed="true"]:not(:disabled):hover { border-color:#b6a6ff; background:#8570ef; color:#fff; box-shadow:0 3px 12px #7762e650,0 0 0 1px #a08cf533; }
}
.me-zoom-label { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:17px; font-size:12px; line-height:1.5; }
.me-zoom-label > label { color:var(--muted); }
.me-zoom-label > output { color:var(--text); font-weight:600; font-variant-numeric:tabular-nums; }
.me-zoom-range { display:block; width:100%; height:19px; margin:3px 0 0; accent-color:var(--accent); cursor:pointer; }
.me-stage { --me-tools-width:40px; --me-tools-gap:10px; display:flex; flex-direction:column; min-width:0; min-height:0; }
.me-board { display:grid; grid-template-columns:minmax(0,1fr) var(--me-tools-width); gap:var(--me-tools-gap); min-width:0; min-height:0; height:clamp(360px,52vw,540px); }
.me-preview { position:relative; min-width:0; min-height:0; height:100%; overflow:hidden; border:1px solid var(--line); border-radius:18px; background:repeating-conic-gradient(color-mix(in srgb,var(--text) 4%,var(--card)) 0 25%,var(--card) 0 50%) 0 0 / 22px 22px; }
.me-preview canvas { position:absolute; inset:0; display:block; width:100%; height:100%; min-width:0; min-height:0; max-width:100%; max-height:100%; object-fit:contain; object-position:center; opacity:1; transition:opacity .2s ease; }
.me-preview canvas[data-me-canvas] { inset:auto; left:50%; top:50%; width:auto; height:auto; min-width:0; min-height:0; max-width:none; max-height:none; object-fit:fill; transform-origin:center; transition:transform .65s cubic-bezier(.22,.72,.18,1),opacity .2s ease; }
.me-preview canvas.me-ghost { z-index:1; object-fit:fill; pointer-events:none; }
.me-preview[aria-busy="true"] canvas { opacity:.45; }
.me-preview[data-me-image-active="true"] { cursor:grab; touch-action:none; }
.me-preview[data-me-dragging="true"] { cursor:grabbing; }
.me-preview-state { position:absolute; left:30%; right:30%; bottom:20px; height:3px; margin:0; overflow:hidden; border-radius:4px; background:color-mix(in srgb,var(--accent) 18%,transparent); pointer-events:none; }
.me-preview-state::after { content:""; position:absolute; inset:0; border-radius:inherit; background:var(--accent); transform-origin:left; animation:me-load 1.3s ease-in-out infinite; }
.me-board-tools { display:flex; flex-direction:column; align-self:center; gap:7px; padding:4px; border:1px solid var(--line); border-radius:11px; background:var(--card); }
.me-board-tools > button { display:grid; place-items:center; flex:none; width:30px; height:36px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--muted); cursor:pointer; }
.me-board-tools > button > svg { width:18px; height:18px; }
.me-device-zoom { display:block; width:30px; color:var(--muted); font-size:9px; line-height:1.5; text-align:center; font-variant-numeric:tabular-nums; }
.me-board-tools > button[aria-pressed="true"] { background:color-mix(in srgb,var(--accent) 12%,transparent); color:var(--accent); }
.me-board-tools > button:disabled { opacity:.35; cursor:default; }
.me-tool-separator { height:1px; margin:3px; background:var(--line); }
.me-stage-bottom { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:17px; }
.me-stage-bottom[data-has-image="true"] { display:grid; grid-template-columns:minmax(0,1fr) auto; }
.me-stage-bottom[data-has-image="false"] { padding-inline-end:calc(var(--me-tools-width) + var(--me-tools-gap)); }
.me-stage-bottom[data-has-image="false"] .me-download-actions { margin-inline:auto; }
.me-editor .me-download { flex:0 1 auto; min-height:42px; padding:10px 16px; font-size:13px; cursor:pointer; }
.me-download-actions { display:flex; align-items:stretch; width:176px; max-width:100%; margin-left:auto; }
.me-editor .me-download-actions > button { width:100%; min-width:0; min-height:42px; padding:10px 16px; font-size:13px; justify-content:center; cursor:pointer; }
.me-download:disabled,.me-blank-download:disabled { opacity:.5; cursor:default; box-shadow:none; }
.me-error { margin:12px 0 0; padding:10px 13px; border:1px solid color-mix(in srgb,#d77b79 35%,var(--line)); border-radius:9px; color:var(--text); background:color-mix(in srgb,#d77b79 7%,var(--card)); font-size:12px; line-height:1.5; }
.me-credit-changes { display:block; }
.me-sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.me-room-tip { position:absolute; z-index:4; top:110px; right:20px; width:236px; padding:15px 17px; border:1px solid color-mix(in srgb,var(--accent2) 31%,var(--line)); border-radius:16px; background:color-mix(in srgb,var(--card) 93%,transparent); box-shadow:0 10px 30px #1b15451a,inset 0 1px 0 #ffffff25; backdrop-filter:blur(13px); color:var(--text); pointer-events:none; }
.me-room-tip strong { display:block; padding-right:15px; font-size:12px; font-weight:650; line-height:1.4; }
.me-room-tip p { margin:6px 0 0; color:var(--muted); font-size:11px; line-height:1.55; }
.me-tip-close { position:absolute; top:8px; right:8px; display:grid; place-items:center; width:19px; height:19px; padding:0; border:0; border-radius:5px; background:transparent; color:var(--muted); cursor:pointer; pointer-events:auto; }
.me-tip-close > svg { width:13px; height:13px; }
.me-tip-arrow { position:absolute; inset:0 auto auto 0; width:1px; height:1px; overflow:visible; color:#a18af5; filter:drop-shadow(0 0 3px #9a7ff0aa) drop-shadow(0 0 10px #8666ee60); animation:me-tip-glow 2.2s ease-in-out infinite; pointer-events:none; }
:root[data-theme="light"] .me-tip-arrow { color:#8462d9; filter:drop-shadow(0 0 3px #9a7ff0a0) drop-shadow(0 0 9px #8666ee48); }
.me-editor[data-expanded="true"] { position:fixed; z-index:10000; inset:0; display:grid; grid-template-rows:auto minmax(0,1fr); width:100%; height:100dvh; margin:0; padding:24px; overflow:hidden; background:var(--bg); }
.me-editor[data-expanded="true"] .me-heading { margin-bottom:20px; }
.me-editor[data-expanded="true"] .me-workspace { grid-template-columns:minmax(260px,326px) minmax(0,1fr); min-height:0; align-items:stretch; }
.me-editor[data-expanded="true"] .me-controls { min-height:0; overflow:visible; }
.me-editor[data-expanded="true"] .me-board { flex:1; height:auto; min-height:0; }
.me-editor[data-expanded="true"] .me-stage-bottom { flex:none; margin-top:13px; }
@media (hover:hover) { .me-expand:hover,.me-view:hover,.me-picker-trigger:hover,.me-image-rotate:hover { border-color:var(--accent); color:var(--text); } .me-upload:hover { border-color:var(--accent); } .me-board-tools > button:not(:disabled):hover { background:color-mix(in srgb,var(--accent) 10%,transparent); color:var(--accent); } }
@media (max-width:1100px) { .me-stage-bottom[data-has-image="true"] { grid-template-columns:minmax(0,1fr); } }
@media (max-width:760px) {
  .me-title-line { gap:11px; }
  .me-workspace { grid-template-columns:minmax(0,1fr); }
  .me-controls { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(100px,1fr) auto; gap:17px; max-height:600px; }
  .me-control + .me-control { margin-top:0; }
  .me-control:first-child { grid-column:auto; }
  .me-board { height:440px; }
  .me-editor[data-expanded="true"] .me-workspace { grid-template-columns:minmax(170px,.8fr) minmax(0,1.2fr); grid-template-rows:minmax(0,1fr); }
  .me-editor[data-expanded="true"] .me-controls { align-content:stretch; grid-template-rows:auto minmax(0,1fr) auto; max-height:none; }
  .me-editor[data-expanded="true"] .me-board { height:auto; }
  .me-room-tip { width:220px; top:98px; right:16px; padding:13px 15px; border-radius:14px; }
}
@media (max-width:480px) {
  .me-editor { padding-top:29px; }
  .me-controls { padding:18px; }
  .me-control + .me-control { margin-top:0; }
  .me-views { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .me-board { height:380px; }
  .me-stage-bottom { align-items:flex-start; }
  .me-editor[data-expanded="true"] { padding:18px; }
  .me-editor[data-expanded="true"] .me-intro { display:none; }
  .me-editor[data-expanded="true"] .me-workspace { grid-template-columns:minmax(135px,.8fr) minmax(0,1.2fr); gap:10px; }
  .me-editor[data-expanded="true"] .me-controls { display:grid; grid-template-columns:minmax(0,1fr); gap:12px; padding:10px; }
  .me-editor[data-expanded="true"] .me-control + .me-control { margin-top:0; }
  .me-editor[data-expanded="true"] .me-views { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@keyframes me-load { 0%,100% { transform:translateX(-70%) scaleX(.3); } 50% { transform:translateX(70%) scaleX(.5); } }
@keyframes me-tip-glow { 0%,100% { opacity:.75; } 50% { opacity:1; } }
@media (prefers-reduced-motion:reduce) { .me-view,.me-upload,.me-preview canvas,.me-picker-trigger > svg,.me-editor .me-blank-download { transition:none; } .me-tip-arrow,.me-preview-state::after { animation:none; } }

.me-image-setting[data-fit-locked="true"] { opacity:.55; }
.me-image-setting[data-fit-locked="true"] .me-zoom-range { cursor:default; }
.me-image-setting[data-fit-locked="true"] output { font-size:10px; letter-spacing:.015em; }
.me-editor .me-image-corner { position:absolute; z-index:2; display:grid; place-items:center; width:22px; height:22px; min-height:0; margin:0; padding:0; border:0; border-radius:50%; background:transparent; box-shadow:none; transform:translate(-50%,-50%); touch-action:none; }
.me-editor .me-image-corner::after { content:""; width:8px; height:8px; border:1px solid #eee8ff; border-radius:50%; background:#9b7de8; box-shadow:0 0 0 1px #5c429880,0 1px 5px #15112140; transition:transform .16s ease; }
.me-editor .me-image-corner:hover::after,.me-editor .me-image-corner:focus-visible::after { transform:scale(1.25); }
.me-editor .me-image-corner:focus-visible { outline:2px solid var(--accent); outline-offset:0; }
.me-preview[data-me-resizing="true"],.me-preview[data-me-resizing="true"] canvas { cursor:var(--me-resize-cursor,nwse-resize); }

@media (max-width: 1199px) {
  .me-room-tip { display: none; }
}
@media (max-width: 600px) {
  .me-editor .me-views { grid-template-columns: repeat(auto-fit, minmax(min(88px, 100%), 1fr)); }
  .me-view-card { display: grid; grid-template-rows: 1fr auto; gap: 2px; }
  .me-view-card > .me-view-download { position: static; width: 100%; }
}
