/* =============================================================================
 *  02-layout.css — 页面骨架
 *  左：固定宽度控制栏（品牌 / 滚动区 / 吸底导出区）
 *  右：预览舞台（画布 + 说明 + 右下工具条）
 * ========================================================================== */

.app {
  display: flex;
  height: 100%;
  background: var(--page);
}

/* ------------------------------- 左侧控制栏 ------------------------------- */
.side {
  width: 342px;
  flex: 0 0 342px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--page);
}

.side-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 12px;
}
.side-head h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--ink);
}
.side-head .sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .3px;
}
.head-actions { display: flex; gap: 2px; }

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 18px 18px;
  scrollbar-gutter: stable;
}

/* 吸底导出区 */
.side-foot {
  flex: 0 0 auto;
  padding: 12px 18px 16px;
  background: linear-gradient(180deg, rgba(244, 245, 247, 0), var(--page) 14px);
  border-top: 1px solid var(--line);
}

.credits {
  margin-top: 12px;
  text-align: center;
}
.credits .credits-link {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.credits .credits-link:hover { color: var(--blue); }
.credits p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}
.credits .credits-brand {
  color: var(--blue);
  font-weight: 700;
  letter-spacing: .2px;
}
.credits .credits-brand:hover { text-decoration: underline; }

/* ------------------------------- 右侧舞台 ------------------------------- */
.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 40px 26px;
  background:
    radial-gradient(760px 420px at 52% 10%, #fbfcfd 0%, rgba(251, 252, 253, 0) 70%),
    var(--page);
  position: relative;
  overflow: hidden;
}

.canvas-frame {
  position: relative;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-canvas);
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow .2s;
}
.canvas-frame.dragging { box-shadow: 0 14px 40px -8px rgba(16, 24, 40, .22), 0 0 0 2px var(--blue-line); }

#canvas {
  display: block;
  border-radius: 3px;
  background: #eef0f3;
  touch-action: none;
}

/* 透明底模式：用棋盘格表示画布上的透明区域（仅界面示意，不影响导出） */
#canvas.is-clear {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e2e6ec 25%, transparent 25%, transparent 75%, #e2e6ec 75%),
    linear-gradient(45deg, #e2e6ec 25%, transparent 25%, transparent 75%, #e2e6ec 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

.stage-caption {
  max-width: 560px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.7;
}

.stage-meta {
  position: absolute;
  right: 20px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.stage-meta .sep { width: 1px; height: 10px; background: var(--line-2); }
.stage-meta button { color: var(--ink-2); font-size: 11px; }
.stage-meta button:hover { color: var(--blue); }

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 1080px) {
  .side { width: 312px; flex-basis: 312px; }
  .stage { padding: 26px 22px 22px; }
}

@media (max-width: 880px) {
  body { overflow: auto; }
  .app { flex-direction: column; height: auto; min-height: 100%; }
  .stage {
    order: -1;
    height: 46vh;
    flex: 0 0 46vh;
    padding: 18px 16px 12px;
  }
  .side { width: 100%; flex: 1 1 auto; }
  .side-scroll { overflow: visible; }
  .stage-caption { display: none; }
  .stage-meta { display: none; }
}
