:root {
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  color: #1f2933;
  background: #eef1f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid #c8d0d9;
  border-radius: 8px;
  background: #ffffff;
  color: #27323f;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: #8fa1b5;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  background: #eef2f6;
  color: #7b8794;
}

button.active {
  border-color: #2563eb;
  background: #e9f1ff;
  color: #1646a3;
  font-weight: 700;
}

button.primary {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.sidebar {
  min-height: 100vh;
  overflow: auto;
  border-right: 1px solid #d5dbe3;
  background: #f8fafc;
  padding: 20px;
}

.brand h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
}

.brand p,
.toolbar span,
.info-card p {
  margin: 0;
  color: #667383;
}

.field {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  color: #405064;
}

.field input {
  min-height: 40px;
  border: 1px solid #c8d0d9;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.queue-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -8px 0 20px;
  color: #405064;
}

.queue-filter input {
  width: 16px;
  height: 16px;
}

.asset-panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  color: #405064;
}

.asset-list {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.asset-list button {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  text-align: left;
}

.asset-list button.selected {
  border-color: #2563eb;
  background: #edf4ff;
}

.thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: contain;
  background: linear-gradient(45deg, #dbe3ec 25%, transparent 25%),
    linear-gradient(-45deg, #dbe3ec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dbe3ec 75%),
    linear-gradient(-45deg, transparent 75%, #dbe3ec 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.asset-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.asset-text {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.asset-subline {
  color: #667383;
  font-size: 12px;
  line-height: 1.25;
}

.asset-empty {
  color: #667383;
  border: 1px dashed #c8d0d9;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.badge {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  background: #e7ebf0;
  color: #596779;
}

.badge.done {
  background: #def7e8;
  color: #166534;
}

.workspace {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #d5dbe3;
  background: #ffffff;
}

.steps button {
  min-height: 44px;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #d5dbe3;
  background: #f8fafc;
}

.toolbar strong {
  display: block;
  margin-bottom: 4px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tools button {
  min-height: 38px;
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #d9e4dd;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

canvas.pan-ready {
  cursor: grab;
}

canvas.panning {
  cursor: grabbing;
}

.info-card {
  position: absolute;
  right: 18px;
  top: 18px;
  width: min(340px, calc(100% - 36px));
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
  padding: 14px;
  pointer-events: none;
}

.info-card strong {
  display: block;
  margin-bottom: 6px;
}

dl {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 12px 0 0;
  font-size: 13px;
}

dt {
  color: #667383;
}

dd {
  margin: 0;
  min-width: 0;
  word-break: break-all;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    max-height: 34vh;
    border-right: 0;
    border-bottom: 1px solid #d5dbe3;
  }

  .workspace {
    height: 66vh;
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .tools {
    justify-content: flex-start;
  }
}
