.templateCreatePage {
  display: flex;
  flex-direction: column;
  height: 89vh;
  background: #f5f7fa;
  padding: 0 16px 16px;
  box-sizing: border-box;
}

.topBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.breadcrumb {
  font-size: 14px;
}

.workspace {
  display: flex;
  flex: 1;
  gap: 12px;
  min-height: 0;
}

.leftPanel {
  width: 220px;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.librarySelect {
  width: 100%;
}

.componentList {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.componentCard {
  background: #f7f8fa;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.componentCard:hover {
  border-color: #00d47f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.componentPreview {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f3f6ff 0%, #fff 100%);
}

.previewPlaceholder {
  width: 90%;
  height: 68px;
  border: 1px dashed #b6c4ff;
  border-radius: 4px;
  color: #5b7bff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.componentTitle {
  text-align: center;
  padding: 8px 4px 10px;
  font-size: 13px;
  color: #333;
}

.centerPanel {
  flex: 1;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.canvasHeader {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f0f0;
}

.canvasTitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.editIcon {
  color: #999;
}

.canvasMeta {
  display: flex;
  gap: 16px;
  color: #666;
  font-size: 12px;
}

.canvasWrapper {
  display: flex;
  flex: 1;
  min-height: 0;
}

.canvasToolbar {
  width: 46px;
  background: #f5f5f5;
  border-right: 1px solid #e5e6eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.toolbarIcon {
  width: 28px;
  height: 28px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  background: #fff;
}

.canvasSurface {
  position: relative;
  flex: 1;
  background: #fafafa;
  border-radius: 0 4px 4px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvasGrid {
  position: absolute;
  inset: 18px 18px 54px 18px;
  border: 1px solid #d9d9d9;
  background-image: linear-gradient(0deg, transparent 24%, rgba(0, 0, 0, 0.03) 25%, rgba(0, 0, 0, 0.03) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, 0.03) 75%, rgba(0, 0, 0, 0.03) 76%, transparent 77%),
    linear-gradient(90deg, transparent 24%, rgba(0, 0, 0, 0.03) 25%, rgba(0, 0, 0, 0.03) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, 0.03) 75%, rgba(0, 0, 0, 0.03) 76%, transparent 77%);
  background-size: 28px 28px;
  background-color: #fff;
  border-radius: 4px;
}

.canvasZoom {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e6eb;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.zoomLabel {
  font-size: 12px;
  color: #555;
}

.rightPanel {
  width: 320px;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 4px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  overflow-y: auto;
}

.rightHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #333;
}

.formSection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sectionTitle {
  font-size: 13px;
  color: #666;
}

.inlineControl {
  width: 100%;
}

.inlineInputs {
  display: flex;
  gap: 8px;
}

.shortInput {
  width: 50%;
}

.fullWidth {
  width: 100%;
}

.marginGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.pageTemplates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pageTemplateCard {
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  background: #fafafa;
}

.pageTemplatePreview {
  width: 100%;
  height: 48px;
  border: 1px dashed #d3d3d3;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.pageTemplateLabel {
  font-size: 12px;
  color: #666;
  text-align: center;
}
