* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f5f6f8;
  color: #222;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #2c5e4f 0%, #4a8a6f 100%);
  color: #fff;
  padding: 14px 24px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
header .brand { display: flex; align-items: center; gap: 10px; }
header h1 { font-size: 18px; font-weight: 600; }
header .logo { font-size: 22px; }
header .ver { font-size: 11px; opacity: 0.7; margin-left: 6px; }
nav {
  display: flex; gap: 4px; margin-top: 14px;
}
nav button {
  background: rgba(255,255,255,0.1);
  border: none; color: #fff;
  padding: 9px 18px; cursor: pointer;
  border-radius: 6px 6px 0 0;
  font-size: 14px;
  transition: background 0.15s;
}
nav button:hover { background: rgba(255,255,255,0.2); }
nav button.active { background: #fff; color: #2c5e4f; font-weight: 600; }

main { padding: 24px; max-width: 1400px; margin: 0 auto; }
section { display: none; }
section.active { display: block; }
h2 { font-size: 20px; margin-bottom: 16px; color: #2c5e4f; }
h3 { font-size: 14px; margin-bottom: 10px; color: #444; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }

.form {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.form label {
  display: block;
  font-size: 12px;
  color: #666;
  margin: 8px 0 4px;
  font-weight: 500;
}
.form input, .form select, .form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d5d8;
  border-radius: 5px;
  font-size: 14px;
  font-family: inherit;
  background: #fafbfc;
  transition: border-color 0.15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: #4a8a6f; background: #fff;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.req { color: #c0392b; }

.actions {
  margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap;
}
button {
  background: #fff;
  border: 1px solid #d0d5d8;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
button:hover { background: #f0f2f4; }
button.primary {
  background: #4a8a6f; color: #fff; border-color: #4a8a6f;
}
button.primary:hover { background: #3d7560; }
button.mini {
  padding: 3px 8px; font-size: 11px; margin-left: 6px;
}

.preview {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.preview iframe {
  width: 100%; min-height: 400px;
  border: 1px solid #e5e8ea;
  background: #fafafa;
  border-radius: 4px;
}

.toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 14px;
}
.toolbar input { padding: 8px 12px; border: 1px solid #d0d5d8; border-radius: 5px; }
.upload {
  display: inline-block;
  background: #fff; border: 1px solid #d0d5d8;
  padding: 8px 16px; border-radius: 5px;
  cursor: pointer; font-size: 13px;
}
.upload:hover { background: #f0f2f4; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.data-table th { background: #f0f2f4; padding: 10px 12px; text-align: left; font-size: 12px; color: #666; font-weight: 600; }
.data-table td { padding: 10px 12px; border-top: 1px solid #eef0f2; font-size: 13px; }
.data-table tr:hover td { background: #fafbfc; }

.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: #fff; border-radius: 8px; padding: 24px;
  width: 480px; max-width: 90vw; max-height: 90vh; overflow: auto;
}
.modal.wide { width: 700px; }

.picklist {
  max-height: 50vh; overflow: auto;
  border: 1px solid #eef0f2; border-radius: 4px; margin-top: 10px;
}
.picklist .item {
  padding: 10px 14px; border-bottom: 1px solid #eef0f2; cursor: pointer;
}
.picklist .item:hover { background: #f0f2f4; }
.picklist .item:last-child { border-bottom: none; }

/* 内嵌产品选择面板 */
.pick-panel {
  margin-top: 16px;
  padding: 14px;
  border: 2px solid #4a8a6f;
  border-radius: 6px;
  background: #f7faf8;
}
.pick-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.pick-panel-head h4 {
  margin: 0; font-size: 14px; color: #2c5e4f;
}
.pick-panel input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d0d8d5;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 8px;
}
.pick-panel .picklist {
  max-height: 240px;
  margin-top: 0;
  background: #fff;
}

.printers {
  border: 1px solid #eef0f2; border-radius: 6px; background: #fafbfc;
  padding: 10px; min-height: 60px;
}
.printer-item {
  padding: 10px; border-bottom: 1px solid #eef0f2;
  display: flex; justify-content: space-between; align-items: center;
}
.printer-item:last-child { border-bottom: none; }
.printer-item .name { font-weight: 600; }
.printer-item .meta { font-size: 11px; color: #888; }
.printer-item button { font-size: 11px; padding: 4px 10px; }

.erp-status {
  background: #fafbfc; padding: 14px; border-radius: 6px;
  border: 1px solid #eef0f2; font-size: 13px; line-height: 1.8;
}

footer {
  text-align: center; padding: 18px; color: #888; font-size: 12px;
}