/* ======================================================================
   image-editor-pro · 图形工作台（独立视觉：石墨蓝 + 橙 + 三栏编辑器）
   ====================================================================== */

.ie-page {
    --ie-bg: #0f1217;
    --ie-panel: #161b22;
    --ie-panel2: #1c232c;
    --ie-ink: #eef2f7;
    --ie-ink2: #a7b3c2;
    --ie-ink3: #6d7a8a;
    --ie-line: #262f3a;
    --ie-orange: #ff8a3d;
    --ie-blue: #4ea8ff;
    --ie-mono: ui-monospace, "SFMono-Regular", Consolas, "Cascadia Mono", monospace;

    background: var(--ie-bg);
    color: var(--ie-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    padding-bottom: 8px;
}

.ie-wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.ie-hero { padding: 30px 0 18px; display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 26px; align-items: start; }
.ie-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--ie-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ie-orange); border: 1px solid #4a2f1c; background: #241708;
    padding: 5px 10px; margin-bottom: 14px;
}
.ie-eyebrow::before { content: "◆"; font-size: 8px; }
.ie-hero h1 { margin: 0 0 12px; font-size: clamp(26px, 3.3vw, 36px); line-height: 1.2; letter-spacing: -.012em; font-weight: 800; }
.ie-hero h1 em {
    display: block; margin-top: 8px; font-style: normal;
    font-size: clamp(14px, 1.5vw, 16px); font-weight: 600; color: var(--ie-ink2); line-height: 1.65;
}
.ie-lead { margin: 0; font-size: 14.5px; line-height: 1.85; color: var(--ie-ink2); max-width: 63ch; }
.ie-lead b { color: var(--ie-ink); box-shadow: inset 0 -.5em 0 rgba(255, 138, 61, .18); }
.ie-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.ie-chips span {
    font-family: var(--ie-mono); font-size: 11.5px; color: var(--ie-ink2);
    border: 1px solid var(--ie-line); padding: 4px 8px; background: var(--ie-panel);
}
.ie-side { background: var(--ie-panel); border: 1px solid var(--ie-line); border-left: 3px solid var(--ie-orange); padding: 15px; }
.ie-side h2 { margin: 0 0 9px; font-size: 13px; }
.ie-side ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; font-size: 12.5px; color: var(--ie-ink2); line-height: 1.6; }
.ie-side p { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--ie-line); font-size: 11.5px; color: var(--ie-ink3); line-height: 1.6; }

/* 画布区 */
.ie-desk { background: var(--ie-panel); border: 1px solid var(--ie-line); overflow: hidden; }
.ie-desk-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--ie-line); background: var(--ie-panel2); }
.ie-desk-head b { font-size: 13.5px; }
.ie-desk-head span { margin-left: auto; font-family: var(--ie-mono); font-size: 11.5px; color: var(--ie-ink3); }

.ie-body { display: grid; grid-template-columns: 56px minmax(0, 1fr) 274px; min-height: 520px; }

/* 左侧工具条 */
.ie-tools { border-right: 1px solid var(--ie-line); background: var(--ie-panel2); display: grid; align-content: start; gap: 2px; padding: 8px 0; }
.ie-tool {
    appearance: none; border: 0; background: none; color: var(--ie-ink2);
    display: grid; justify-items: center; gap: 3px; padding: 9px 2px; cursor: pointer;
    font-size: 10px; transition: .14s;
}
.ie-tool i { font-style: normal; font-size: 16px; line-height: 1; }
.ie-tool:hover { color: var(--ie-ink); background: #222a34; }
.ie-tool.is-on { color: #1a0d02; background: var(--ie-orange); font-weight: 700; }
.ie-tools hr { border: 0; border-top: 1px solid var(--ie-line); margin: 6px 10px; }

/* 舞台 */
.ie-stage {
    position: relative; overflow: auto; display: flex; align-items: center; justify-content: center;
    padding: 22px;
    background:
        linear-gradient(45deg, #171c23 25%, transparent 25%, transparent 75%, #171c23 75%) 0 0 / 18px 18px,
        linear-gradient(45deg, #171c23 25%, transparent 25%, transparent 75%, #171c23 75%) 9px 9px / 18px 18px,
        #12161c;
}
.ie-canvas-wrap { position: relative; box-shadow: 0 0 0 1px #2a3542, 0 16px 40px rgba(0, 0, 0, .45); }
#ieCanvas { display: block; cursor: crosshair; touch-action: none; }
.ie-crop-mask { position: absolute; inset: 0; pointer-events: none; display: none; }
.ie-crop-mask.is-on { display: block; background: rgba(0, 0, 0, .45); }
.ie-crop-rect { position: absolute; border: 1.5px dashed var(--ie-orange); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35); display: none; }
.ie-crop-rect.is-on { display: block; }
.ie-stage-empty {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; color: var(--ie-ink3); font-size: 12.5px; text-align: center; pointer-events: none;
}
.ie-stage-empty b { color: var(--ie-ink2); font-size: 15px; }

/* hidden 属性必须能压过上面的 display:flex，否则导入图片后空状态仍盖在画布上 */
.ie-stage-empty[hidden] { display: none; }

/* 右侧面板 */
.ie-panel { border-left: 1px solid var(--ie-line); background: var(--ie-panel); display: grid; align-content: start; }
.ie-sec { border-bottom: 1px solid var(--ie-line); padding: 10px 12px; display: grid; gap: 8px; }
.ie-sec h3 { margin: 0; font-family: var(--ie-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ie-orange); }

.ie-layerlist { display: grid; gap: 4px; max-height: 210px; overflow: auto; }
.ie-layer {
    display: flex; align-items: center; gap: 6px; padding: 6px 7px;
    border: 1px solid var(--ie-line); background: var(--ie-panel2); font-size: 12px; color: var(--ie-ink2);
    cursor: pointer;
}
.ie-layer.is-active { border-color: var(--ie-orange); color: var(--ie-ink); }
.ie-layer .ie-eye { border: 0; background: none; color: inherit; cursor: pointer; font-size: 13px; padding: 0 2px; }
.ie-layer b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ie-layer .ie-mini { margin-left: auto; display: flex; gap: 3px; }
.ie-layer .ie-mini button { border: 1px solid var(--ie-line); background: var(--ie-panel); color: var(--ie-ink2); font-size: 10px; padding: 1px 4px; cursor: pointer; }
.ie-layer .ie-mini button:hover { border-color: var(--ie-orange); color: var(--ie-orange); }

.ie-field { display: grid; gap: 3px; font-size: 12px; color: var(--ie-ink2); }
.ie-field .ie-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ie-field input[type="range"] { width: 100%; accent-color: var(--ie-orange); }
.ie-field input[type="text"], .ie-field input[type="number"], .ie-field select, .ie-field textarea {
    width: 100%; box-sizing: border-box; background: var(--ie-bg); color: var(--ie-ink);
    border: 1px solid var(--ie-line); font-size: 12.5px; padding: 6px 7px; font-family: inherit;
}
.ie-field textarea { min-height: 52px; resize: vertical; }
.ie-field output { font-family: var(--ie-mono); font-size: 11px; color: var(--ie-orange); }
.ie-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.ie-btn {
    appearance: none; border: 1px solid var(--ie-line); background: var(--ie-panel2);
    color: var(--ie-ink); font-size: 12.5px; font-weight: 600; padding: 8px 10px;
    cursor: pointer; transition: .14s;
}
.ie-btn:hover:not(:disabled) { border-color: var(--ie-orange); color: var(--ie-orange); }
.ie-btn:disabled { opacity: .4; cursor: not-allowed; }
.ie-btn-main { background: var(--ie-orange); border-color: var(--ie-orange); color: #1a0d02; font-weight: 800; }
.ie-btn-main:hover:not(:disabled) { filter: brightness(1.06); color: #1a0d02; }

/* 底部动作 */
.ie-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--ie-line); background: var(--ie-panel2); }
.ie-actions .ie-tip { margin-left: auto; font-family: var(--ie-mono); font-size: 11.5px; color: var(--ie-ink3); }

.ie-msg { margin: 0; padding: 8px 16px 14px; font-size: 12.5px; line-height: 1.65; color: var(--ie-ink3); }
.ie-msg.is-err { color: #ff8a7a; }
.ie-msg.is-ok { color: #7fca97; }

@media (max-width: 1080px) {
    .ie-hero { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
    .ie-body { grid-template-columns: 52px minmax(0, 1fr); }
    .ie-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--ie-line); }
}

@media (max-width: 520px) {
    .ie-wrap { padding: 0 12px; }
    .ie-body { grid-template-columns: 46px minmax(0, 1fr); }
    .ie-actions .ie-tip { margin-left: 0; width: 100%; }
}
