/* 桌面端横屏优先；不在此拦截移动端 */
:root {
  --bg: #1a1d23;
  --panel: #23272f;
  --border: #3d4450;
  --text: #e6e9ef;
  --muted: #8b92a3;
  --accent: #5b9cf6;
  --accent-hover: #7eb0f8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  display: flex;
  flex-direction: column;
  min-width: 720px;
  min-height: 480px;
}

.toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.upload-btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: var(--accent);
  color: #0f1419;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.upload-btn:hover {
  background: var(--accent-hover);
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  min-height: 0;
  background: var(--border);
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
}

.panel-title {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.canvas-host {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
  background: #2a2f38;
  position: relative;
  user-select: none;
}

.canvas-viewport {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: max(160%, 900px);
  min-height: max(160%, 600px);
  transform-origin: 0 0;
}

.canvas-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  cursor: crosshair;
}

.canvas-viewport > svg {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  max-width: none;
  max-height: none;
}

.canvas-viewport > svg .svg-edit-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.canvas-marquee {
  position: absolute;
  border: 2px dashed var(--accent);
  background: rgba(91, 156, 246, 0.12);
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
}

.code-editor {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0.75rem;
  border: none;
  resize: none;
  font-family: "Consolas", "Cascadia Code", monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text);
  background: #1e2228;
  tab-size: 2;
}

.code-editor:focus {
  outline: none;
}
