/* 编辑器外壳。刻意保持素净 —— 页面本身才是主角。 */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #d9d7d1;
  color: #2a2825;
  font: 14px/1.5 'Noto Sans SC', -apple-system, sans-serif;
}

/* ---------- 顶栏 ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 22px;
  background: #0D3B3B;
  color: #f2efe9;
}
.bar__brand {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.bar__brand span {
  font-weight: 400;
  opacity: .6;
  font-size: 14px;
  margin-left: 4px;
}
.bar__meta { display: flex; gap: 16px; }
.bar__meta label { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .85; }
.bar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.bar input,
.bar select {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  border-radius: 3px;
  padding: 4px 7px;
  font: inherit;
  width: 92px;
}
.bar select { width: auto; }
.bar select option { color: #2a2825; }
.bar input:focus-visible,
.bar select:focus-visible { outline: 2px solid #5A9E94; outline-offset: 1px; }

.status { font-size: 12px; opacity: .7; min-width: 90px; text-align: right; }

.btn {
  font: inherit;
  padding: 6px 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: #f2efe9;
  cursor: pointer;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:disabled { opacity: .45; cursor: default; }
.btn--go { background: #5A9E94; border-color: #5A9E94; color: #06231f; font-weight: 500; }
.btn--go:hover { background: #6fb3a8; }
.btn--mini { padding: 1px 8px; font-size: 12px; border-color: #0D3B3B; color: #0D3B3B; }
.btn--mini:hover { background: rgba(13, 59, 59, .08); }

/* ---------- 布局 ---------- */

.wrap {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 0;
  height: calc(100vh - 53px);
}

.panel {
  overflow-y: auto;
  padding: 18px 20px 60px;
  background: #f2f1ed;
  border-right: 1px solid #cbc8c1;
}

details { margin-bottom: 22px; }
summary {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 15px;
  color: #0D3B3B;
  cursor: pointer;
  padding-bottom: 10px;
  border-bottom: 1px solid #cbc8c1;
  margin-bottom: 12px;
}
summary .btn--mini { float: right; margin-top: -2px; }

.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block;
  font-size: 12px;
  color: #6b6864;
  margin-bottom: 4px;
  letter-spacing: .03em;
}
.field em { font-style: normal; opacity: .7; margin-left: 6px; font-size: 11px; }

.field input,
.field textarea,
.fig input,
.fig select {
  width: 100%;
  font: inherit;
  padding: 7px 9px;
  border: 1px solid #cbc8c1;
  border-radius: 3px;
  background: #fbfbfa;
  color: #2a2825;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid #5A9E94; outline-offset: -1px; border-color: transparent; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.tools { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.btn--warn { border-color: #b9847e; color: #a8524a; }
.btn--warn:hover { background: rgba(168, 82, 74, .1); }

.hint { font-size: 11.5px; color: #7d7a75; line-height: 1.7; margin: 6px 0 0; }
.hint code {
  background: #e2e0da;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

/* ---------- 图片投放区 ---------- */

.drop {
  border: 1px dashed #b6b2aa;
  border-radius: 4px;
  padding: 18px;
  text-align: center;
  color: #8b8781;
  font-size: 12.5px;
  cursor: pointer;
  background: #fbfbfa;
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over { border-color: #5A9E94; background: #eef5f3; color: #0D3B3B; }
.drop.has { padding: 6px; border-style: solid; }
.drop img { max-width: 100%; max-height: 130px; display: block; margin: 0 auto; }

/* ---------- 插图页卡片 ---------- */

.fig {
  border: 1px solid #cbc8c1;
  border-radius: 4px;
  padding: 11px;
  margin-bottom: 12px;
  background: #fbfbfa;
}
.fig__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 12px;
  color: #6b6864;
}
.fig__top select { width: auto; flex: 1; padding: 3px 6px; font-size: 12px; }
.fig__del {
  margin-left: auto; border: 0; background: none; cursor: pointer;
  color: #a8524a; font-size: 16px; line-height: 1; padding: 0 4px;
}
.fig__slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.fig input { font-size: 12px; }
.fig__cap + .fig__cap { margin-top: 6px; }

.fig__share {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b6864;
  margin-bottom: 8px;
  cursor: pointer;
}
.fig__share input { width: auto; margin: 0; accent-color: #0D3B3B; }
.fig__share em { font-style: normal; opacity: .65; font-size: 11px; }

/* ---------- 预览 ---------- */

.preview { display: flex; flex-direction: column; overflow: hidden; }
.preview__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 20px;
  background: #e6e4de;
  border-bottom: 1px solid #cbc8c1;
  font-size: 12px;
  color: #6b6864;
}
.zoom { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.pages { overflow: auto; padding: 26px 0 80px; }

/* 页面按缩放系数摆放：外层占位，内层原尺寸后 transform 缩小 */
.slot { margin: 0 auto; position: relative; }
.slot__inner { transform-origin: top left; position: absolute; top: 0; left: 0; }
.slot .page { box-shadow: 0 12px 32px rgba(30, 28, 24, .22); }

.sep {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  padding: 9px 0;
  font-size: 11.5px;
  color: #7d7a75;
}
.sep__label { letter-spacing: .06em; }
.sep__btn {
  border: 1px solid #b6b2aa;
  background: #fbfbfa;
  color: #0D3B3B;
  border-radius: 3px;
  width: 26px;
  height: 22px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.sep__btn:hover { background: #0D3B3B; color: #fbfbfa; border-color: #0D3B3B; }
.sep__n { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.sep__warn { color: #a8524a; font-weight: 500; }
