:root {
  --primary: #1890ff;
  --primary-hover: #40a9ff;
  --sidebar: #001529;
  --page: #ffffff;
  --gray: #f5f5f5;
  --border: #e8e8e8;
  --border-dark: #d9d9d9;
  --text: #262626;
  --muted: #595959;
  --weak: #8c8c8c;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --info-bg: #e6f7ff;
  --success-bg: #f6ffed;
  --warning-bg: #fffbe6;
  --danger-bg: #fff2f0;
  --radius: 2px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font: 14px/1.5 "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  background: var(--page);
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 208px;
  background: var(--sidebar);
  color: rgba(255, 255, 255, 0.75);
  z-index: 5;
}

.logo {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.logo-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: var(--radius);
  font-size: 12px;
}

.nav {
  padding: 12px 8px;
}

.nav-item {
  width: 100%;
  height: 42px;
  padding: 0 16px;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: #fff;
  background: var(--primary);
}

.main {
  width: calc(100% - 208px);
  margin-left: 208px;
  min-height: 100vh;
  background: var(--page);
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--page);
  position: sticky;
  top: 0;
  z-index: 4;
}

.breadcrumb {
  margin-bottom: 4px;
  color: var(--weak);
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 600;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

h3 {
  font-size: 14px;
  font-weight: 600;
}

.top-actions,
.section-head,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view {
  display: none;
  padding: 24px;
}

.view.active {
  display: block;
}

.filter-band {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  background: var(--gray);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 190px;
  height: 32px;
  padding: 4px 11px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

.btn {
  min-width: 88px;
  height: 32px;
  padding: 0 15px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.btn:hover {
  border-color: var(--primary-hover);
  color: var(--primary);
}

.btn.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn.ghost {
  background: #fff;
}

.btn.disabled {
  color: rgba(0, 0, 0, 0.25);
  background: #f5f5f5;
  border-color: var(--border-dark);
  cursor: not-allowed;
}

.notice {
  padding: 10px 14px;
  border: 1px solid;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.notice.warning {
  color: #ad6800;
  background: var(--warning-bg);
  border-color: #ffe58f;
}

.notice.info {
  color: #0958d9;
  background: var(--info-bg);
  border-color: #91d5ff;
}

.section {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.section.compact {
  margin: 0;
}

.section > h2,
.section-head {
  min-height: 48px;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.section > h2 {
  display: flex;
  align-items: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 16px;
}

.summary-grid div {
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  margin: -1px 0 0 -1px;
}

.summary-grid span {
  display: block;
  color: var(--weak);
  font-size: 12px;
  margin-bottom: 4px;
}

.summary-grid strong {
  font-size: 14px;
  font-weight: 500;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 12px;
  white-space: nowrap;
}

.tag.blue {
  color: #0958d9;
  background: var(--info-bg);
  border: 1px solid #91d5ff;
}

.tag.green {
  color: #389e0d;
  background: var(--success-bg);
  border: 1px solid #b7eb8f;
}

.tag.orange {
  color: #ad6800;
  background: var(--warning-bg);
  border: 1px solid #ffe58f;
}

.tag.red {
  color: #cf1322;
  background: var(--danger-bg);
  border: 1px solid #ffccc7;
}

.tag.gray {
  color: var(--muted);
  background: var(--gray);
  border: 1px solid var(--border);
}

.segment {
  display: inline-flex;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  overflow: hidden;
}

.segment button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--border-dark);
  background: #fff;
  cursor: pointer;
}

.segment button:last-child {
  border-right: 0;
}

.segment button.active {
  color: #fff;
  background: var(--primary);
}

.version-panel {
  display: none;
  padding: 16px;
}

.version-panel.active {
  display: block;
}

.standard-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.product-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.product-visual {
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f5ff 0%, #fff 55%, #f6ffed 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.shirt {
  position: relative;
  width: 110px;
  height: 138px;
  background: #526f8c;
  border-radius: 16px 16px 8px 8px;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.08);
}

.shirt::before,
.shirt::after {
  content: "";
  position: absolute;
  top: 26px;
  width: 42px;
  height: 78px;
  background: #526f8c;
  border-radius: 18px 18px 8px 8px;
}

.shirt::before {
  left: -36px;
  transform: rotate(20deg);
}

.shirt::after {
  right: -36px;
  transform: rotate(-20deg);
}

.shirt span {
  position: absolute;
  left: 48px;
  top: 0;
  width: 14px;
  height: 52px;
  background: #f7f7f7;
}

.product-panel p {
  margin-top: 4px;
  color: var(--muted);
}

.version-meta {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--gray);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fafafa;
}

.measure-table th,
.measure-table td {
  text-align: center;
}

.process-table {
  min-width: 860px;
}

.process-table td:last-child {
  min-width: 300px;
  line-height: 1.6;
}

.process-image-thumb {
  width: 72px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: linear-gradient(135deg, #f4f7fb 0%, #fff 100%);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.process-image-thumb.empty-thumb {
  background: var(--gray);
  color: var(--weak);
}

.pool-table {
  min-width: 1480px;
}

.pool-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.order-table th,
.order-table td {
  text-align: center;
  white-space: nowrap;
}

.order-table td:nth-child(2) {
  text-align: left;
}

.num {
  margin-left: 4px;
  color: #fa6400;
}

.order-summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.order-summary strong {
  color: var(--text);
}

.selection-detail {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
}

.product-gallery {
  min-width: 0;
}

.product-photo {
  height: 310px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.65), transparent 42%),
    linear-gradient(135deg, #cab68c 0%, #f5e8d2 44%, #bd9b77 100%);
}

.product-photo::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 120px;
  height: 212px;
  border-radius: 56px 56px 20px 20px;
  background: linear-gradient(135deg, #f0b9bc, #cf808a);
  box-shadow: -54px 56px 0 -30px #916746, 58px 66px 0 -30px #916746;
  transform: translateX(-50%);
}

.product-photo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 28px;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #c88967;
  box-shadow: -46px 34px 0 -18px #5d3b2d, 44px 170px 0 -26px #efbdc4;
  transform: translateX(-50%);
}

.thumb-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.thumb {
  width: 46px;
  height: 46px;
  display: inline-block;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #e8d7bd, #b88f68);
}

.thumb.active {
  border: 2px solid var(--primary);
}

.detail-main {
  min-width: 0;
}

.detail-main > h2 {
  margin: 6px 0 8px;
  line-height: 1.45;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--weak);
  font-size: 12px;
}

.detail-meta strong {
  color: var(--primary);
  font-weight: 500;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 14px;
  border: 1px solid var(--border);
}

.status-strip div {
  min-height: 56px;
  padding: 8px 12px;
  border-right: 1px solid var(--border);
}

.status-strip div:last-child {
  border-right: 0;
}

.status-strip span,
.detail-info-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--weak);
  font-size: 12px;
}

.status-strip strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 28px;
}

.detail-info-grid div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  min-height: 24px;
}

.detail-info-grid span {
  margin: 0;
}

.detail-info-grid strong {
  font-weight: 400;
}

.color-dot {
  width: 12px;
  height: 12px;
  display: inline-flex;
  margin-right: 6px;
  border: 1px solid var(--border-dark);
  border-radius: 50%;
  vertical-align: -1px;
}

.color-dot.light {
  background: #d8dce2;
}

.color-dot.khaki {
  background: #c9ad7f;
}

.color-dot.black {
  background: #1f1f1f;
}

.component-table {
  min-width: 1080px;
}

.component-table th:first-child,
.component-table td:first-child {
  width: 160px;
}

.component-table select,
.component-table input {
  width: 100%;
  min-width: 120px;
}

.color-multi-select {
  position: relative;
  min-width: 210px;
}

.color-multi-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.color-multi-select.open .color-multi-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.12);
}

.color-multi-values {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.color-multi-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 24px;
  padding: 0 6px 0 8px;
  border-radius: var(--radius);
  background: #e6f7ff;
  color: #096dd9;
  white-space: nowrap;
}

.color-multi-remove {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d6e4ff;
  color: #597ef7;
  font-size: 14px;
  line-height: 14px;
  cursor: pointer;
}

.color-multi-placeholder {
  color: var(--weak);
  line-height: 24px;
}

.color-multi-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.color-multi-select.open .color-multi-arrow {
  transform: rotate(180deg);
}

.color-multi-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  display: none;
  width: max-content;
  min-width: 240px;
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.color-multi-select.open .color-multi-menu {
  display: block;
}

.color-menu-options {
  padding: 4px 0;
}

.color-menu-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: var(--text);
  cursor: pointer;
}

.color-menu-option:hover {
  background: #f5f5f5;
}

.color-menu-all {
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.color-menu-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-menu-check {
  position: relative;
  width: 16px;
  height: 16px;
  border: 1px solid #bfbfbf;
  border-radius: var(--radius);
  background: #fff;
}

.color-menu-option input:checked + .color-menu-check {
  border-color: var(--primary);
  background: var(--primary);
}

.color-menu-option input:checked + .color-menu-check::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}
}

.wash-label-section {
  border-color: #91d5ff;
}

.wash-label-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  padding: 16px;
}

.wash-editor-stack {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.inline-template {
  padding: 0;
}

.inline-template .template-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-template .template-card {
  min-height: 92px;
}

.wash-preview-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.preview-head select {
  width: 124px;
  height: 28px;
  padding: 2px 6px;
}

.wash-preview-panel .label-preview {
  flex: 1;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.45fr);
  gap: 16px;
  margin-top: 16px;
}

.label-preview {
  min-height: 244px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}

.label-preview strong {
  font-size: 16px;
}

.label-preview.label-size-standard {
  min-height: 330px;
  aspect-ratio: 3 / 10;
  align-content: start;
  overflow: hidden;
}

.label-preview.label-size-child {
  min-height: 520px;
  aspect-ratio: 3 / 14;
  align-content: start;
  overflow: hidden;
  gap: 8px;
}

.label-hook {
  width: 58%;
  height: 10px;
  margin: -8px auto 2px;
  border-bottom: 1px solid #111;
}

.child-label-details {
  width: 100%;
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-dark);
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
}

.child-label-details p {
  width: 100%;
  color: var(--text);
  font-size: 10px;
  text-align: left;
}

.child-label-details strong {
  font-size: inherit;
}

.child-origin {
  margin-top: 3px;
  font-weight: 600;
}

.wash-icons {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}

.wash-icons i {
  width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  font-style: normal;
  font-size: 11px;
}

.margin-top {
  margin-top: 16px;
}

.link-btn {
  padding: 0;
  margin-right: 10px;
  color: var(--primary);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.link-btn.danger {
  color: var(--danger);
}

.anchor-layout {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.anchor-layout aside {
  position: sticky;
  top: 92px;
  height: fit-content;
  display: grid;
  gap: 8px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

.anchor-layout aside a {
  padding: 6px 8px;
  color: var(--muted);
}

.anchor-layout aside a:hover {
  color: var(--primary);
}

.info-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.info-list h3 {
  margin-bottom: 12px;
}

.info-list p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.info-list span {
  color: var(--weak);
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.7fr) minmax(320px, 0.3fr);
  gap: 24px;
  padding: 24px;
}

.review-modal {
  min-height: 360px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--weak);
  cursor: pointer;
  font-size: 18px;
}

.required {
  color: var(--muted);
}

.required::before {
  content: "*";
  color: var(--danger);
  margin-right: 4px;
}

.radio-row {
  display: flex;
  gap: 12px;
  margin: 12px 0 18px;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  grid-template-columns: none;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.radio-row input {
  width: auto;
  height: auto;
  margin-right: 6px;
}

.check-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.check-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.check-row:last-child {
  border-bottom: 0;
}

.check-row span {
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
}

.check-row.ok span {
  background: var(--success);
}

.check-row.error span {
  background: var(--danger);
}

.check-row.ok {
  color: #389e0d;
}

.check-row.error {
  color: #cf1322;
}

.review-rules {
  padding: 20px;
  background: var(--gray);
  border-radius: var(--radius);
}

.review-rules ol {
  margin: 14px 0 0 18px;
  padding: 0;
  color: var(--muted);
}

.review-rules li {
  margin-bottom: 10px;
}

.review-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.radio-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  min-height: 76px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.radio-card input {
  width: auto;
  height: auto;
  grid-row: span 2;
  margin-top: 3px;
}

.radio-card strong {
  font-weight: 600;
}

.radio-card span {
  color: var(--weak);
  font-size: 12px;
}

.radio-card.active {
  border-color: var(--primary);
  background: var(--info-bg);
}

.inline-input {
  width: 100%;
  height: 28px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  padding: 16px;
}

.component-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  padding: 16px;
}

.modal-component-layout {
  padding: 0;
}

.preset-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafafa;
}

.preset-panel h3 {
  margin-bottom: 4px;
}

.preset-block {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.preset-block strong {
  font-weight: 600;
}

.preset-block span,
.preset-block p {
  color: var(--muted);
  font-size: 12px;
}

.preset-block p {
  line-height: 1.7;
}

.component-editor {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.component-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--gray);
}

.selected-color-panel {
  min-height: 52px;
  display: grid;
  align-content: end;
  gap: 6px;
}

.selected-color-panel > span {
  color: var(--muted);
  font-size: 12px;
}

.selected-color-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
}

.color-chip.muted {
  color: var(--muted);
  background: #fafafa;
}

.component-toolbar label {
  min-width: 160px;
}

.component-toolbar .wide-control {
  min-width: 360px;
  flex: 1;
}

.component-toolbar select {
  width: 160px;
}

.component-toolbar .wide-control select {
  width: 100%;
}

.required-mark {
  margin-right: 4px;
  color: var(--danger);
}

.side-check {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: #fafafa;
}

.side-check h3 {
  margin-bottom: 12px;
}

.check-ok,
.check-error {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
}

.check-ok {
  color: #389e0d;
}

.check-error {
  color: #cf1322;
}

.check-ok::before,
.check-error::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.check-ok::before {
  background: var(--success);
}

.check-error::before {
  background: var(--danger);
}

.rule-box {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 12px;
  color: var(--muted);
  background: var(--warning-bg);
  border: 1px solid #ffe58f;
}

.hidden {
  display: none !important;
}

.snapshot-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.snapshot-band div {
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  margin: -1px 0 0 -1px;
}

.snapshot-band span {
  display: block;
  margin-bottom: 4px;
  color: var(--weak);
  font-size: 12px;
}

.snapshot-band strong {
  font-size: 13px;
  font-weight: 500;
}

.switch {
  display: inline-flex;
  align-items: center;
}

.switch input {
  display: none;
}

.switch span {
  width: 36px;
  height: 20px;
  position: relative;
  border-radius: 10px;
  background: var(--border-dark);
  cursor: pointer;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: all 0.2s;
}

.switch input:checked + span {
  background: var(--primary);
}

.switch input:checked + span::after {
  left: 18px;
}

.wash-method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.template-layout {
  display: block;
  padding: 0;
}

.template-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.template-card {
  display: grid;
  gap: 6px;
  min-height: 102px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.template-card:hover,
.template-card.active,
.template-card.selected {
  border-color: var(--primary);
}

.template-card.active,
.template-card.selected {
  background: var(--info-bg);
}

.template-card span,
.template-card em {
  color: var(--weak);
  font-size: 12px;
  font-style: normal;
}

.template-detail {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.template-title {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.template-title-main,
.template-title-meta,
.template-select-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.template-title-main {
  flex: 1;
  min-width: 180px;
  flex-wrap: nowrap;
}

.template-select-control {
  grid-template-columns: none;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.template-select-control select {
  width: 200px;
  height: 28px;
  padding: 3px 8px;
}

.template-title-meta {
  flex: 0 0 auto;
}

.template-title-meta label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.template-title-meta input {
  width: 112px;
  height: 28px;
  padding: 3px 8px;
  color: var(--text);
  background: var(--gray);
  cursor: default;
}

.compact-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.wash-card {
  min-height: 92px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 16px 12px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.wash-card.missing {
  border-color: #ffccc7;
  background: var(--danger-bg);
}

.wash-symbol {
  width: 42px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #111;
  color: #111;
  font-weight: 600;
}

.wash-card span {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.wash-card .empty {
  color: var(--danger);
}

.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--gray);
}

.action-footer span {
  color: var(--muted);
}

.submit-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px;
}

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px 18px;
}

.submit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wash-standard {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(180px, 0.35fr);
  gap: 16px;
  padding: 16px;
}

.suit-preview {
  border: 1px solid var(--border);
  background: #fff;
  line-height: 1.35;
}

.suit-preview p {
  color: var(--text);
}

.empty-table {
  height: 96px;
  color: var(--weak);
  text-align: center;
  background: #fafafa;
}

.empty-preview {
  color: var(--weak);
}

.suit-preview span {
  color: var(--muted);
}

.small-preview {
  min-height: 300px;
  padding: 16px 12px;
}

.print-config label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.print-config input[type="checkbox"] {
  width: auto;
  height: auto;
}

.print-content-fixed {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
}

.print-content-fixed strong {
  font-size: 14px;
  color: var(--text);
}

.print-content-fixed span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.large-preview {
  min-height: 360px;
  border: 1px solid var(--border);
}

.large-preview.label-size-standard {
  min-height: 420px;
}

.large-preview.label-size-child {
  min-height: 650px;
}

.print-call {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

.print-config {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  background: var(--gray);
  border-radius: var(--radius);
}

.print-config h3 {
  margin-top: 8px;
}

.print-config h3:first-child {
  margin-top: 0;
}

.print-config select,
.print-config input:not([type="checkbox"]) {
  width: 100%;
}

.print-preview {
  min-height: 420px;
}

.print-size-map {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: #fafafa;
  text-align: center;
}

.print-size-map strong {
  font-weight: 600;
}

.print-size-map p {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 10px 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  border-radius: var(--radius);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 24px;
  background: rgba(0, 0, 0, 0.45);
}

.modal-mask.open {
  display: flex;
}

.modal {
  width: 640px;
  max-width: 100%;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding: 20px 24px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.modal.large {
  width: 900px;
}

.modal.xlarge {
  width: 1180px;
}

/* AI作图方案 */
.ai-image-plan-modal {
  width: 1040px;
  padding: 0;
}

.ai-image-plan-modal .modal-title-row {
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.ai-image-plan-modal .modal-title-row strong {
  display: block;
  font-size: 16px;
}

.ai-image-plan-modal .modal-subtitle {
  margin-top: 2px;
}

.ai-plan-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  color: var(--weak);
  background: #fafcff;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.ai-plan-steps span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ai-plan-steps b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 11px;
}

.ai-plan-steps span:not(.active) {
  color: var(--weak);
}

.ai-plan-steps span:not(.active) b {
  color: var(--weak);
  background: #d9d9d9;
}

.ai-plan-steps i {
  width: 64px;
  height: 1px;
  background: #b7e0ff;
}

.ai-plan-notice {
  margin: 16px 24px 0;
  border-radius: var(--radius);
}

.ai-plan-block {
  margin: 16px 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ai-plan-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: #fcfcfd;
}

.ai-plan-block-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
}

.ai-plan-block-head p {
  margin: 4px 0 0 27px;
  color: var(--weak);
  font-size: 12px;
}

.plan-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #096dd9;
  background: var(--info-bg);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}

.ai-task-table-wrap {
  overflow-x: auto;
}

.ai-task-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 12px;
}

.ai-task-table th,
.ai-task-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.ai-task-table th {
  color: var(--muted);
  background: #fafafa;
  font-size: 11px;
  font-weight: 600;
}

.ai-task-table tr:last-child td {
  border-bottom: 0;
}

.ai-task-table th:first-child,
.ai-task-table td:first-child {
  width: 170px;
}

.ai-spec-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.ai-spec-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.ai-spec-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

.ai-spec-check small {
  color: var(--weak);
  font-size: 11px;
}

.task-selection-note {
  color: var(--weak);
  font-size: 12px;
}

.ai-task-table.task-disabled {
  opacity: 0.56;
}

.strategy-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.strategy-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 74px;
  padding: 13px;
  color: var(--text);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  cursor: pointer;
}

.strategy-option.checked {
  border-color: var(--primary);
  background: #f0f8ff;
}

.strategy-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.strategy-radio {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 1px solid #bfbfbf;
  border-radius: 50%;
  background: #fff;
}

.strategy-option.checked .strategy-radio {
  border: 4px solid var(--primary);
}

.strategy-option strong,
.strategy-option small {
  display: block;
}

.strategy-option strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.strategy-option small {
  color: var(--weak);
  font-size: 12px;
  line-height: 1.5;
}

.ai-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 16px 24px 0;
  padding: 11px 14px;
  color: #0958d9;
  background: #f0f8ff;
  border: 1px solid #b7e0ff;
  border-radius: var(--radius);
  font-size: 12px;
}

.ai-flow strong {
  margin-right: 8px;
  color: #0958d9;
  font-size: 12px;
}

.ai-flow span {
  white-space: nowrap;
}

.ai-flow i {
  color: #69b1ff;
  font-style: normal;
}

.ai-reference-block {
  margin-bottom: 16px;
}

.reference-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.reference-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.reference-card:hover,
.reference-card.selected {
  border-color: var(--primary);
}

.reference-card.selected {
  box-shadow: 0 0 0 1px var(--primary);
}

.reference-image {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  height: 122px;
  padding: 8px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 11px;
}

.reference-image::before {
  position: absolute;
  left: 50%;
  bottom: -16px;
  width: 76px;
  height: 115px;
  border-radius: 36px 36px 10px 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: -33px 24px 0 -20px rgba(255, 255, 255, 0.92), 33px 24px 0 -20px rgba(255, 255, 255, 0.92);
  content: "";
  transform: translateX(-50%);
}

.reference-image i,
.reference-image b {
  position: relative;
  z-index: 1;
  font-style: normal;
}

.reference-image i {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 1px 4px;
  color: rgba(0, 0, 0, 0.62);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 2px;
  font-size: 10px;
}

.reference-image-one { background: linear-gradient(135deg, #9dc9ca 0%, #4a7477 100%); }
.reference-image-two { background: linear-gradient(135deg, #e6caa0 0%, #a56d55 100%); }
.reference-image-three { background: linear-gradient(135deg, #cbc5db 0%, #5f607d 100%); }
.reference-image-four { background: linear-gradient(135deg, #b9d1bb 0%, #55765e 100%); }
.reference-image-two::before { width: 64px; height: 105px; border-radius: 22px 22px 7px 7px; }
.reference-image-three::before { width: 70px; height: 122px; border-radius: 34px 34px 16px 16px; }
.reference-image-four::before { width: 72px; height: 112px; border-radius: 12px 12px 30px 30px; }

.reference-copy {
  display: block;
  padding: 9px 10px 10px;
}

.reference-copy strong,
.reference-copy small {
  display: block;
}

.reference-copy strong { font-size: 12px; }
.reference-copy small { margin-top: 2px; color: var(--weak); font-size: 11px; }

.reference-check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
}

.reference-card.selected .reference-check { display: flex; }

.selected-reference-order {
  margin: 0 16px 16px;
  padding: 12px;
  background: #fafcff;
  border: 1px solid var(--border);
}

.selected-reference-order-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 10px;
}

.selected-reference-order-head strong {
  font-size: 12px;
}

.selected-reference-order-head span {
  color: var(--weak);
  font-size: 11px;
}

.selected-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-reference-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 182px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--border-dark);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.selected-reference-item.primary {
  border-color: var(--primary);
  background: #f0f8ff;
}

.selected-reference-item.dragging {
  opacity: 0.42;
  cursor: grabbing;
}

.selected-reference-thumb {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  overflow: hidden;
}

.selected-reference-thumb::before {
  bottom: -8px;
  width: 34px;
  height: 56px;
  border-radius: 16px 16px 5px 5px;
  box-shadow: -16px 14px 0 -11px rgba(255, 255, 255, 0.92), 16px 14px 0 -11px rgba(255, 255, 255, 0.92);
}

.selected-reference-thumb i,
.selected-reference-thumb b {
  display: none;
}

.selected-reference-no {
  position: absolute;
  z-index: 2;
  top: 3px;
  left: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #096dd9;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}

.selected-reference-item.primary .selected-reference-no {
  color: #fff;
  background: var(--primary);
}

.selected-reference-name {
  flex: 1;
  min-width: 0;
}

.selected-reference-name strong,
.selected-reference-name small {
  display: block;
}

.selected-reference-name strong { font-size: 12px; }
.selected-reference-name small { color: var(--weak); font-size: 11px; }

.ai-plan-actions {
  justify-content: flex-end;
  min-height: 64px;
  padding: 0 24px;
  border-top: 1px solid var(--border);
}

.copy-notice {
  margin: 0 0 16px;
}

.copy-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.print-sheet {
  border: 1px solid var(--border);
  padding: 20px;
}

.print-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.print-head p {
  margin-bottom: 8px;
}

.print-warning {
  margin-bottom: 16px;
  padding: 8px 12px;
  color: #ad6800;
  background: var(--warning-bg);
  border: 1px solid #ffe58f;
}

.logic-chain {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 8px 0 18px;
}

.logic-chain div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid #91d5ff;
  background: var(--info-bg);
  color: #0958d9;
  text-align: center;
}

.logic-chain span {
  color: var(--weak);
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: 100%;
  }

  .app-shell {
    display: block;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    min-width: 140px;
  }

  .topbar,
  .standard-layout,
  .two-col,
  .review-layout,
  .anchor-layout,
  .print-head,
  .logic-chain,
  .review-result,
  .editor-layout,
  .component-layout,
  .selection-detail,
  .wash-label-layout,
  .template-layout,
  .wash-method-grid,
  .compact-grid,
  .submit-panel,
  .check-list,
  .action-footer,
  .wash-standard,
  .print-call {
    grid-template-columns: 1fr;
  }

  .action-footer,
  .component-toolbar {
    align-items: stretch;
  }

  .component-toolbar select,
  .component-toolbar label {
    width: 100%;
  }

  .topbar {
    display: grid;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .status-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .status-strip div:last-child {
    border-bottom: 0;
  }

  .inline-template .template-list {
    grid-template-columns: 1fr;
  }

  .logic-chain span {
    display: none;
  }

  .template-title {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .template-title-meta {
    width: 100%;
    justify-content: space-between;
  }

  .submit-panel {
    align-items: stretch;
  }

  .submit-actions {
    justify-content: flex-end;
  }
}

@media print {
  @page {
    margin: 0;
  }

  body.printing-label > * {
    visibility: hidden !important;
  }

  body.printing-label #systemPrintModal,
  body.printing-label #systemPrintModal * {
    visibility: visible !important;
  }

  body.printing-label #systemPrintModal {
    display: block !important;
    position: static;
    padding: 0;
    background: transparent;
  }

  body.printing-label #systemPrintModal .modal {
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body.printing-label #systemPrintModal .modal-title-row,
  body.printing-label #systemPrintModal .print-config,
  body.printing-label #systemPrintModal .notice,
  body.printing-label #systemPrintModal .modal-actions {
    display: none !important;
  }

  body.printing-label #systemPrintModal .print-call {
    display: block;
    margin: 0;
  }

  body.printing-label #systemPrintModal .print-preview {
    min-height: 0;
  }

  body.printing-label #printComponentPreview {
    width: 3cm;
    height: 10cm;
    min-height: 10cm;
    aspect-ratio: auto;
    padding: 0.15cm;
    border: 0;
    overflow: visible;
  }

  body.printing-label #printComponentPreview.label-size-child {
    height: 14cm;
    min-height: 14cm;
  }
}
