/* AI Image Editor — 工具区样式
 * 对齐主站主题（#09090b 底 / 蓝紫渐变 CTA / glass-panel 卡片）。
 * 前缀 ie- 用于自定义区块；app.js 依赖的工具类名（btn-sm/tool-btn 等）在此补齐，
 * 避免引入原站 63KB 编译 CSS 与站点页头页脚样式冲突。
 */
.ie-main { flex: 1; }
.ie-wrap { max-width: 1200px; margin: 0 auto; padding: 56px 24px 96px; }
/* hidden 兜底：即使 Tailwind CDN 未就绪，上传区/编辑器切换也不失效 */
.hidden { display: none !important; }

/* 标题区 */
.ie-hero { text-align: center; margin-bottom: 36px; }
.ie-badge {
    display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 12px;
    font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: #a5b4fc; background: rgba(99,102,241,.10); border: 1px solid rgba(99,102,241,.22);
}
.ie-title {
    margin: 18px 0 12px; font-size: clamp(30px, 5vw, 46px); line-height: 1.15;
    font-weight: 800; letter-spacing: -.02em;
    background: linear-gradient(100deg,#fff 20%,#a5b4fc 60%,#c4b5fd 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ie-sub { max-width: 760px; margin: 0 auto; font-size: 16px; line-height: 1.7; color: #9ca3af; }

/* 隐私提示 */
.ie-privacy {
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px;
    padding: 14px 18px; border-radius: 14px; font-size: 13.5px; line-height: 1.6;
    color: #6ee7b7; background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.20);
}
.ie-privacy svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }

/* 工具卡片 */
.ie-card {
    background: rgba(255,255,255,.03); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 24px;
}
.ie-error {
    display: none; margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px;
    color: #fca5a5; background: rgba(239,68,68,.10); border: 1px solid rgba(239,68,68,.25);
}

/* 上传区 */
.ie-drop {
    border: 2px dashed rgba(255,255,255,.14); border-radius: 18px; text-align: center;
    padding: 56px 20px; cursor: pointer; transition: all .25s ease; background: rgba(255,255,255,.015);
}
.ie-drop:hover, .ie-drop.dragover, .ie-drop.border-brand-400 {
    border-color: rgba(99,102,241,.7); background: rgba(99,102,241,.06);
    box-shadow: 0 0 40px rgba(99,102,241,.12) inset;
}
.ie-drop-icon {
    width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #a5b4fc; font-size: 30px;
    background: linear-gradient(135deg,rgba(59,130,246,.15),rgba(168,85,247,.15));
    border: 1px solid rgba(129,140,248,.3);
}
.ie-drop-title { font-size: 16px; font-weight: 500; color: #e5e7eb; }
.ie-drop-hint { margin-top: 8px; font-size: 13px; color: #9ca3af; }
.ie-drop-hint2 { margin-top: 6px; font-size: 12px; color: #6b7280; }
.ie-blank-btn {
    display: inline-block; margin-top: 16px; background: none; border: none; cursor: pointer;
    font-size: 14px; color: #93c5fd; text-decoration: underline;
}
.ie-blank-btn:hover { color: #bfdbfe; }

/* ── app.js 依赖的工具类名 ── */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04); color: #9ca3af; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all .15s; position: relative;
}
.tool-btn:hover { border-color: rgba(99,102,241,.6); color: #e5e7eb; }
.tool-btn.active { border-color: #6366f1; background: rgba(99,102,241,.18); color: #a5b4fc; }
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%);
    background: #111827; color: #e5e7eb; font-size: 11px; padding: 3px 8px; border-radius: 6px;
    white-space: nowrap; z-index: 30; border: 1px solid #374151;
}
.color-swatch { width: 26px; height: 26px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: all .12s; }
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px #6366f1; }
.width-chip {
    min-width: 34px; height: 28px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04); color: #9ca3af; font-size: 11px; cursor: pointer;
}
.width-chip.active { border-color: #6366f1; color: #a5b4fc; background: rgba(99,102,241,.14); }
.btn-sm {
    padding: 7px 14px; border-radius: 9px; font-size: 12px; font-weight: 600; cursor: pointer;
    border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: #d1d5db;
    transition: all .15s;
}
.btn-sm:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); }
.btn-sm.primary {
    background: linear-gradient(135deg,#3b82f6,#8b5cf6); border-color: transparent; color: #fff;
}
.btn-sm.primary:hover { filter: brightness(1.12); }
.btn-sm.danger { color: #f87171; }
.canvas-wrap {
    position: relative; background: #0b0d12; border-radius: 12px; overflow: auto;
    display: flex; align-items: center; justify-content: center; min-height: 420px; max-height: 70vh;
    border: 1px solid rgba(255,255,255,.07);
}
.canvas-wrap canvas { max-width: 100%; height: auto; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.canvas-wrap.tool-crop, .canvas-wrap.tool-draw { cursor: crosshair; }
.canvas-wrap.tool-select { cursor: default; }
.layer-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
    border: 1px solid rgba(255,255,255,.10); background: rgba(255,255,255,.03);
    cursor: pointer; font-size: 12px; color: #d1d5db;
}
.layer-item.selected { border-color: #6366f1; background: rgba(99,102,241,.14); }
.layer-item .vis-btn {
    width: 24px; height: 24px; border-radius: 6px; border: none; background: transparent;
    color: #9ca3af; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.layer-item .vis-btn.off { opacity: .35; }
.prop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: #9ca3af; }
.prop-input {
    width: 88px; background: #111827; border: 1px solid rgba(255,255,255,.14); border-radius: 8px;
    color: #e5e7eb; padding: 5px 8px; font-size: 12px;
}
.prop-input.w-full { width: 100%; }
.crop-bar {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px;
    border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
}
.sticky-panel { position: sticky; top: 90px; }
.ie-panel {
    background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px; padding: 16px; margin-bottom: 16px;
}
.ie-panel-title { font-size: 14px; font-weight: 600; color: #e5e7eb; margin-bottom: 12px; }
.ie-canvas-info { margin-top: 8px; font-size: 12px; color: #6b7280; text-align: center; }
.ie-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.ie-divider { width: 1px; height: 28px; background: rgba(255,255,255,.10); }
.ie-grow { flex: 1; }

/* 说明 / FAQ / 相关工具 */
.ie-section { margin-top: 72px; }
.ie-section-title { font-size: 26px; font-weight: 700; color: #fff; text-align: center; margin-bottom: 36px; }
.ie-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ie-step { text-align: center; }
.ie-step .no {
    width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
    background: linear-gradient(135deg,#3b82f6,#8b5cf6); box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.ie-step h3 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.ie-step p { font-size: 13.5px; line-height: 1.7; color: #9ca3af; }
.ie-faq { display: grid; gap: 14px; max-width: 900px; margin: 0 auto; }
.ie-faq-item { background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 20px 22px; }
.ie-faq-item h3 { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 8px; }
.ie-faq-item p { font-size: 13.5px; line-height: 1.75; color: #9ca3af; }
.ie-related { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.ie-related a {
    display: flex; align-items: flex-start; gap: 14px; padding: 18px;
    background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px; transition: all .2s;
}
.ie-related a:hover { border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.05); }
.ie-related .ico {
    width: 40px; height: 40px; flex: none; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; color: #a5b4fc; background: rgba(99,102,241,.10);
}
.ie-related strong { display: block; font-size: 14px; color: #fff; margin-bottom: 4px; }
.ie-related span { font-size: 12.5px; color: #9ca3af; line-height: 1.6; }

/* 自检面板 */
#selftestPanel {
    display: none; margin-top: 20px; padding: 18px; border-radius: 12px;
    background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.09);
    font-size: 12px; line-height: 1.7; color: #a5b4fc; white-space: pre-wrap;
}

@media (max-width: 1024px) {
    .ie-wrap { padding: 36px 16px 64px; }
    .ie-card { padding: 16px; }
    .ie-steps, .ie-related { grid-template-columns: 1fr; }
    .sticky-panel { position: static; }
    .ie-drop { padding: 36px 14px; }
}
