#wp-root * {
  box-sizing: border-box;
  font-family: Microsoft YaHei, Arial, sans-serif;
}

#wp-root .wp-mask {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.46);
}

#wp-root .wp-modal {
  width: 1180px;
  max-width: 98vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.24);
}

#wp-root .wp-head {
  height: 58px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #e8e8e8;
}

#wp-root .wp-title {
  font-size: 17px;
  font-weight: 700;
  color: #1f1f1f;
}

#wp-root .wp-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #888;
}

#wp-root .wp-close {
  padding: 2px 8px;
  border: 0;
  background: transparent;
  color: #888;
  font-size: 24px;
  cursor: pointer;
}

#wp-root .wp-close:hover {
  background: #f5f5f5;
  color: #222;
}

#wp-root .wp-body {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #f5f6f8;
}

#wp-root .wp-form,
#wp-root .wp-preview-pane {
  min-height: 0;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#wp-root .wp-form {
  padding: 12px;
}

#wp-root .wp-preview-pane {
  padding: 12px;
  text-align: center;
}

#wp-root .wp-section-title {
  margin-bottom: 8px;
  padding: 5px 0 8px;
  border-bottom: 1px solid #eee;
  color: #333;
  font-size: 13px;
  font-weight: 700;
}

#wp-root .wp-form-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  color: #555;
  font-size: 13px;
}

#wp-root .wp-form-row > span:first-child {
  width: 76px;
  flex: 0 0 76px;
  text-align: right;
  line-height: 30px;
}

#wp-root .wp-form-row input,
#wp-root .wp-form-row textarea,
#wp-root .wp-item-qty-input {
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: #222;
}

#wp-root .wp-form-row input {
  height: 30px;
  flex: 1 1 auto;
}

#wp-root .wp-form-row textarea {
  flex: 1 1 auto;
  resize: vertical;
  line-height: 1.35;
}

#wp-root .wp-hbd-wrap {
  flex: 1 1 auto;
  display: flex;
  gap: 6px;
}

#wp-root .wp-hbd-wrap input {
  font-family: Consolas, monospace;
  font-weight: 700;
}

#wp-root .wp-regenerate {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #1677ff;
  border-radius: 6px;
  background: #fff;
  color: #1677ff;
  cursor: pointer;
}

#wp-root .wp-items-title {
  margin-top: 10px;
}

#wp-root .wp-page-count {
  float: right;
  color: #888;
  font-weight: 400;
}

#wp-root .wp-item-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#wp-root .wp-item-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
}

#wp-root .wp-item-form-name {
  min-width: 0;
  flex: 1 1 auto;
  color: #444;
  font-size: 12px;
  line-height: 1.35;
}

#wp-root .wp-item-qty-input {
  width: 72px;
  flex: 0 0 72px;
  text-align: right;
}

#wp-root .wp-preview-pages {
  display: inline-block;
}

#wp-root .wp-preview-wrap {
  display: inline-block;
  margin: 0 0 16px;
}

#wp-root .wp-page-no {
  margin-bottom: 4px;
  color: #888;
  font-size: 12px;
}

#wp-root .wp-page {
  position: relative;
  width: 100mm;
  height: 150mm;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d0d0d0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  page-break-after: always;
}

#wp-root .wp-frame,
#wp-root .wp-field {
  position: absolute;
}

#wp-root .wp-field {
  overflow: hidden;
  color: #000;
}

#wp-root .wp-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

#wp-root .wp-logo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #bbb;
  color: #aaa;
  font-size: 12px;
}

#wp-root .wp-barcode {
  display: block;
  width: 100%;
  height: 100%;
}

#wp-root .wp-barcode-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 12px;
}

#wp-root .wp-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.25mm solid #000;
}

#wp-root .wp-item-row {
  position: absolute;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-top: 0.2mm dashed #000;
}

#wp-root .wp-item-name {
  box-sizing: border-box;
  padding: 0 0.5mm;
  overflow: hidden;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  line-height: 1.05;
}

#wp-root .wp-item-qty {
  box-sizing: border-box;
  padding: 0 0.8mm;
  overflow: hidden;
  text-align: right;
  white-space: nowrap;
}

#wp-root .wp-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
}

#wp-root .wp-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
}

#wp-root .wp-btn:hover {
  border-color: #1677ff;
  color: #1677ff;
}

#wp-root .wp-btn-primary {
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

#wp-root .wp-btn-primary:hover {
  background: #4096ff;
  color: #fff;
}

#wp-root .wp-settings-body {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 250px;
  gap: 10px;
  padding: 12px;
  overflow: auto;
  background: #f5f6f8;
}

#wp-root .wp-field-list,
#wp-root .wp-props,
#wp-root .wp-settings-preview {
  overflow: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

#wp-root .wp-settings-preview {
  text-align: center;
}

#wp-root .wp-field-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border-radius: 5px;
  color: #444;
  font-size: 13px;
  cursor: pointer;
}

#wp-root .wp-field-row:hover {
  background: #f5f5f5;
}

#wp-root .wp-field-row.wp-selected {
  background: #e6f4ff;
  color: #1677ff;
}

#wp-root .wp-prop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #555;
  font-size: 13px;
}

#wp-root .wp-prop-row > span {
  width: 58px;
  flex: 0 0 58px;
  text-align: right;
}

#wp-root .wp-prop-row input[type="text"],
#wp-root .wp-prop-row input[type="number"],
#wp-root .wp-prop-row select {
  min-width: 0;
  height: 28px;
  flex: 1 1 auto;
  padding: 0 6px;
  border: 1px solid #d9d9d9;
  border-radius: 5px;
}

#wp-root .wp-prop-row input[type="file"] {
  max-width: 155px;
  font-size: 12px;
}

#wp-root .wp-field.wp-selected,
#wp-root .wp-items-area-handle.wp-selected {
  outline: 2px solid #1677ff;
  outline-offset: -1px;
  background: rgba(22, 119, 255, 0.06);
}

#wp-root .wp-items-area-handle,
#wp-root .wp-frame-handle {
  position: absolute;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 3px;
  border: 1px dashed #1677ff;
  background: rgba(22, 119, 255, 0.06);
  color: #1677ff;
  font-size: 12px;
  cursor: move;
}

#wp-root .wp-sender-modal {
  width: 620px;
}

#wp-root .wp-sender-body {
  padding: 16px;
}

#wp-root .wp-sender-row > span {
  width: 72px;
  flex: 0 0 72px;
  line-height: 30px;
}

#wp-root .wp-sender-text {
  width: 100%;
  min-height: 160px;
  padding: 8px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  resize: vertical;
  line-height: 1.45;
}

#wp-root .wp-empty {
  padding: 18px;
  color: #999;
  font-size: 13px;
  text-align: center;
}

.wp-message {
  position: fixed;
  top: 64px;
  left: 50%;
  z-index: 1000001;
  transform: translateX(-50%);
  padding: 9px 18px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  color: #fff;
  font-size: 14px;
}

.wp-message.wp-ok {
  background: rgba(82, 196, 26, 0.95);
}

.wp-message.wp-err {
  background: rgba(255, 77, 79, 0.95);
}
