/* 九宫格切图工具样式：宫格布局 / 平台模板 / 边框 / 输出格式与质量 */
.jgg-form { margin-top: 14px; }
.jgg-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }

/* 上传区 */
.jgg-drop {
    border: 2px dashed rgba(59, 130, 246, 0.45);
    border-radius: 14px;
    padding: 34px 16px;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(59,130,246,0.06), rgba(59,130,246,0.02));
    transition: all 0.25s ease;
}
.jgg-drop:hover, .jgg-drop.jgg-dragover {
    border-color: var(--color-primary);
    background: rgba(59, 130, 246, 0.08);
    transform: translateY(-1px);
}
.jgg-drop-icon { font-size: 2rem; color: #3b82f6; margin-bottom: 8px; }
.jgg-drop-text { font-weight: 600; margin: 0 0 4px; }
.jgg-drop-sub { font-size: 0.8rem; color: var(--text-gray); margin: 0; }

/* 编辑器整体 */
.jgg-editor {
    background: rgba(248, 250, 252, 0.75);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    overflow: hidden;
}
.jgg-body { display: flex; min-height: 400px; }

/* 设置面板 */
.jgg-panel {
    width: 250px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border-light);
    padding: 14px 12px; overflow-y: auto; max-height: 560px;
}
.jgg-panel-title { font-weight: 700; font-size: 0.88rem; margin: 14px 0 10px; color: #1e293b; }
.jgg-panel-title:first-child { margin-top: 0; }
.jgg-panel-title i { color: #3b82f6; margin-right: 5px; }
.jgg-panel-tip { font-size: 0.74rem; color: var(--text-gray); line-height: 1.6; margin: 8px 0 0; }
.jgg-panel-tip i { color: #60a5fa; margin-right: 3px; }

/* 宫格布局按钮 */
.jgg-layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jgg-layout-btn {
    border: 1px solid var(--border-light); background: #f8fafc; cursor: pointer; border-radius: 10px;
    padding: 9px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: all 0.2s ease; color: #64748b;
}
.jgg-layout-btn:hover { border-color: rgba(59,130,246,0.5); color: #2563eb; transform: translateY(-1px); }
.jgg-layout-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb; color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.jgg-layout-prev { width: 32px; height: 32px; display: grid; gap: 2px; }
.jgg-layout-prev span { background: currentColor; opacity: 0.9; border-radius: 1.5px; }
.jgg-layout-name { font-size: 0.68rem; font-weight: 700; white-space: nowrap; }

/* 平台模板按钮 */
.jgg-platforms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.jgg-platform-btn {
    border: 1px solid var(--border-light); background: #f8fafc; cursor: pointer; border-radius: 9px;
    padding: 7px 6px; text-align: center; transition: all 0.2s ease; color: #334155;
}
.jgg-platform-btn:hover { border-color: rgba(59,130,246,0.5); color: #2563eb; }
.jgg-platform-btn.active {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #3b82f6; color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.jgg-platform-name { display: block; font-size: 0.76rem; font-weight: 700; }
.jgg-platform-ratio { display: block; font-size: 0.62rem; color: #94a3b8; margin-top: 1px; }
.jgg-platform-btn.active .jgg-platform-ratio { color: #60a5fa; }

/* 滑杆 / 颜色 */
.jgg-slider-row { margin-bottom: 10px; }
.jgg-slider-row label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; color: #334155; }
.jgg-slider-row input[type="range"] { width: 100%; accent-color: var(--color-primary); }
.jgg-color-row { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #334155; }
.jgg-color-row label { font-weight: 600; }
.jgg-color-row input[type="color"] {
    width: 34px; height: 30px; padding: 1px 2px; border: 2px solid #e2e8f0; border-radius: 8px;
    cursor: pointer; background: #fff;
}
.jgg-btn-mini {
    border: 1px solid rgba(59,130,246,0.4); background: #eff6ff; color: #2563eb; cursor: pointer;
    border-radius: 8px; padding: 4px 9px; font-size: 0.72rem; font-weight: 600; transition: all 0.2s ease;
    white-space: nowrap;
}
.jgg-btn-mini:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* 输出格式 */
.jgg-formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.jgg-format-btn {
    border: 1px solid var(--border-light); background: #f8fafc; cursor: pointer; border-radius: 9px;
    padding: 7px 4px; font-size: 0.76rem; font-weight: 700; color: #334155; transition: all 0.2s ease;
}
.jgg-format-btn:hover { border-color: rgba(59,130,246,0.5); color: #2563eb; }
.jgg-format-btn.active {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #2563eb; color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

/* 预览区 */
.jgg-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.jgg-stage-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; border-bottom: 1px solid var(--border-light); background: rgba(255,255,255,0.7);
}
.jgg-info { font-size: 0.8rem; font-weight: 600; color: #1e293b; }
.jgg-stage-sub { font-size: 0.72rem; color: var(--text-gray); }
.jgg-stage-scroll { flex: 1; overflow: auto; padding: 16px; display: flex; justify-content: center; align-items: flex-start; }

/* 宫格预览 */
.jgg-grid {
    display: grid; gap: 0; width: 100%; max-width: 620px;
    border-radius: 10px; overflow: hidden;
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.12);
    background: #eef2f7;
}
.jgg-cell { position: relative; cursor: pointer; overflow: hidden; background: #fff; }
.jgg-cell canvas { display: block; width: 100%; height: 100%; }
.jgg-cell-num {
    position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; line-height: 20px;
    padding: 0 5px; border-radius: 10px; background: rgba(15, 23, 42, 0.55); color: #fff;
    font-size: 0.66rem; font-weight: 700; text-align: center; pointer-events: none;
    backdrop-filter: blur(2px);
}
.jgg-cell-dl {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; background: rgba(15, 23, 42, 0.42); color: #fff; font-size: 0.72rem; font-weight: 700;
    opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.jgg-cell-dl i { font-size: 1.2rem; }
.jgg-cell:hover .jgg-cell-dl { opacity: 1; }
.jgg-cell:hover canvas { transform: scale(1.015); transition: transform 0.25s ease; }

/* 操作按钮 */
.jgg-actions {
    display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
    padding: 12px 14px; border-top: 1px solid var(--border-light); background: rgba(255,255,255,0.7);
}
.jgg-btn-main {
    background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.jgg-btn-main:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4); }
.jgg-btn-dl {
    background: #fff; color: #2563eb; border: 1px solid rgba(59,130,246,0.5);
}
.jgg-btn-dl:hover { background: #eff6ff; transform: translateY(-1px); }

/* 进度 */
.jgg-progress { padding: 10px 14px 14px; border-top: 1px solid var(--border-light); background: #fff; }
.jgg-progress-head {
    display: flex; justify-content: space-between; font-size: 0.76rem; font-weight: 600;
    color: #334155; margin-bottom: 6px;
}
.jgg-progress-track { height: 8px; border-radius: 6px; background: #e2e8f0; overflow: hidden; }
.jgg-progress-bar {
    height: 100%; width: 0%; border-radius: 6px;
    background: linear-gradient(90deg, #3b82f6, #2563eb); transition: width 0.2s ease;
}

/* 响应式 */
@media (max-width: 860px) {
    .jgg-body { flex-direction: column; }
    .jgg-panel { width: 100%; max-height: none; border-right: none; border-bottom: 1px solid var(--border-light); }
    .jgg-stage-scroll { padding: 12px; }
}
