/* ===== 基础 ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: #eef2f7;
  color: #1f2937;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

/* ===== 整体布局：左侧面板 + 右侧预览 ===== */
.shell {
  display: grid;
  grid-template-columns: 370px 1fr;
  height: 100vh;
}

/* ===== 左侧控制面板 ===== */
aside {
  background: #fff;
  border-right: 1px solid #d9e2ec;
  padding: 20px;
  overflow: auto;
}

h1 {
  margin: 0 0 6px;
  font-size: 23px;
}

.sub {
  margin: 0 0 16px;
  color: #64748b;
  line-height: 1.55;
  font-size: 13px;
}

section {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 16px;
}

h2 {
  font-size: 15px;
  margin: 0 0 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 11px;
}

/* 勾选类（横向排布） */
label.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: -4px 0 4px;
}

label.checkbox-field input[type="checkbox"] {
  width: auto;
  accent-color: #2563eb;
}

input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

input,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

/* 位置读数 */
.pos {
  white-space: pre-line;
  background: #f1f5f9;
  border-radius: 9px;
  padding: 9px;
  font: 12px/1.5 Consolas, monospace;
  margin: 10px 0;
}

/* 按钮 */
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 9px;
  padding: 10px;
  margin-top: 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

button.primary {
  background: #2563eb;
  color: #fff;
}

#batch {
  background: #e9f7ef;
  color: #087443;
}

/* 文件列表 */
.file {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  border-radius: 7px;
  margin: 4px 0;
  font-size: 11px;
  cursor: pointer;
}

.file:hover {
  background: #eef2f7;
}

.file.active {
  background: #dbeafe;
  outline: 1px solid #93c5fd;
}

.file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file > span:first-child {
  flex: 1;
  min-width: 0;
}

/* 移除按钮：覆盖全局 button 样式，保持行内紧凑 */
.file-remove {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  padding: 2px 6px;
  margin: 0;
  width: auto;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.file-remove:hover {
  color: #dc2626;
  background: #fee2e2;
}

.note {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.5;
}

/* ===== 右侧预览区 ===== */
main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
}

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 16px;
  background-color: #cbd5e1;
  background-image:
    linear-gradient(45deg, #ffffff55 25%, transparent 25%),
    linear-gradient(-45deg, #ffffff55 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ffffff55 75%),
    linear-gradient(-45deg, transparent 75%, #ffffff55 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  position: relative;
  overflow: hidden;
}

header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

header span {
  color: #64748b;
  font-size: 12px;
}

.stage canvas {
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  box-shadow: 0 18px 50px #0f172a47;
  border-radius: 7px;
  background: #111827;
}

.stage #empty {
  position: absolute;
  color: #64748b;
}

/* ===== 窄屏适配 ===== */
@media (max-width: 850px) {
  .shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  aside {
    border-right: 0;
    border-bottom: 1px solid #d9e2ec;
  }

  .stage {
    height: 75vh;
  }
}
