/* xiutu.org 在线编辑器样式 */
.editor-body { overflow: hidden; height: 100vh; display: flex; flex-direction: column; }

/* 顶栏 */
.ed-topbar {
  background: var(--dark); color: #e8eaed; display: flex; align-items: center;
  justify-content: space-between; padding: 8px 16px; flex-shrink: 0; flex-wrap: wrap; gap: 8px;
}
.ed-logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.ed-title { font-weight: 700; font-size: 17px; line-height: 1.15; }
.ed-title small { display: block; font-size: 11px; font-weight: 400; color: #9aa3ad; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-btn {
  background: #3d424a; color: #e8eaed; border: 1px solid #4a505a; border-radius: 8px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; transition: .15s;
}
.ed-btn:hover { background: #4a505a; }
.ed-btn.primary { background: var(--blue); border-color: var(--blue); }
.ed-btn.primary:hover { background: var(--blue-dark); }
.ed-btn:disabled { opacity: .45; cursor: not-allowed; }

/* 布局 */
.ed-main { flex: 1; display: grid; grid-template-columns: 64px 1fr 250px; min-height: 0; }

/* 左侧工具 */
.ed-tools {
  background: #33373d; display: flex; flex-direction: column; align-items: center;
  padding: 10px 0; gap: 4px; overflow-y: auto;
}
.tool {
  width: 52px; padding: 7px 0 5px; background: none; border: none; border-radius: 8px;
  color: #c3c9d2; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: 18px; transition: .15s;
}
.tool span { font-size: 10px; }
.tool:hover { background: #454a52; color: #fff; }
.tool.active { background: var(--blue); color: #fff; }
.tool.ai { color: #ffd76e; }
.tool-sep { width: 36px; height: 1px; background: #4a505a; margin: 6px 0; }

/* 画布区 */
.ed-stage-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ed-stage {
  flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#dfe4ea 0 25%, #eef1f5 0 50%) 0 0/24px 24px;
  position: relative; padding: 24px;
}
.canvas-holder { position: relative; box-shadow: 0 8px 30px rgba(0,0,0,.25); background: #fff; }
#viewCanvas { display: block; max-width: 100%; }
.dropzone {
  text-align: center; color: var(--ink-2); border: 2px dashed #b9c4d2;
  border-radius: 16px; padding: 60px 40px; background: rgba(255,255,255,.75);
  max-width: 480px;
}
.dropzone.dragover { border-color: var(--blue); background: var(--blue-light); }
.dz-icon { font-size: 46px; margin-bottom: 10px; }
.dropzone h2 { color: var(--ink); font-size: 20px; margin-bottom: 8px; }
.dropzone p { font-size: 13.5px; margin-bottom: 18px; }
.dropzone.dragover h2 { color: var(--blue-dark); }

/* 裁剪框 */
.crop-box {
  position: absolute; border: 2px solid var(--blue); cursor: move;
  background: rgba(26,159,255,.10); box-shadow: 0 0 0 9999px rgba(0,0,0,.42);
  min-width: 20px; min-height: 20px;
}
.crop-box::before, .crop-box::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(var(--blue) 0, transparent 0) 0 50%/100% 33.4% no-repeat,
              linear-gradient(90deg, var(--blue) 0, transparent 0) 50% 0/33.4% 100% no-repeat;
  pointer-events: none; opacity: .8;
}
.crop-hint {
  position: absolute; top: -26px; left: 0; background: var(--blue); color: #fff;
  font-size: 12px; padding: 2px 10px; border-radius: 4px; white-space: nowrap;
}

/* 状态栏 */
.ed-statusbar {
  background: #fff; border-top: 1px solid var(--line); padding: 7px 16px;
  display: flex; align-items: center; justify-content: space-between; font-size: 13px;
  color: var(--ink-2); flex-shrink: 0; gap: 10px; flex-wrap: wrap;
}
.crop-ops { display: flex; gap: 8px; }
.btn-sm { padding: 5px 14px; font-size: 13.5px; }

/* 右侧面板 */
.ed-panel {
  background: #fff; border-left: 1px solid var(--line); overflow-y: auto;
  padding: 14px;
}
.panel-sec { border-bottom: 1px solid var(--line); padding: 14px 6px 18px; }
.panel-sec:first-child { padding-top: 4px; }
.panel-sec h3 { font-size: 14.5px; margin-bottom: 12px; color: var(--ink); }
.panel-sec label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin: 10px 0 4px; }
.panel-sec output { color: var(--blue-dark); font-weight: 600; }
input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }
.panel-btn {
  width: 100%; margin-top: 12px; padding: 9px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s;
}
.panel-btn:hover { border-color: var(--blue); color: var(--blue); }
.panel-btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.panel-btn.primary:hover { background: var(--blue-dark); color: #fff; }
.panel-btn:disabled { opacity: .5; cursor: not-allowed; }

.size-row { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.size-row input {
  width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 14px;
}
.size-row input:focus { outline: 2px solid var(--blue-light); border-color: var(--blue); }
.chk { display: flex; gap: 6px; justify-content: flex-start !important; margin-top: 10px; font-size: 13px; }

.sel-label { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; display: block; }
select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 14px; background: #fff;
}
.panel-tip { font-size: 12px; color: var(--ink-2); margin-top: 8px; min-height: 16px; }
.info-line { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; word-break: break-all; }
.adv-link { display: block; font-size: 12.5px; margin-top: 8px; line-height: 1.5; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff; padding: 10px 22px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 响应式 */
@media (max-width: 860px) {
  .editor-body { height: auto; min-height: 100vh; overflow: auto; }
  .ed-main { grid-template-columns: 56px 1fr; }
  .ed-panel { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--line); }
  .ed-stage { min-height: 46vh; }
  .dropzone { padding: 40px 20px; }
}
