:root {
  --ms-accent: #2f6f9f;
  --ms-accent-deep: #1f527b;
  --ms-ink: #17334f;
  --ms-line: #e2ecf5;
  --ms-bg: #f3f8fc;
  --ms-card: #ffffff;
}

.miaoshou-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px 56px;
}

.miaoshou-head h1 {
  font-size: 22px;
  color: var(--ms-ink);
  margin: 6px 0 4px;
}

.miaoshou-head p {
  color: #5a7790;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 14px;
}

.miaoshou-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

@media (max-width: 860px) {
  .miaoshou-cols { grid-template-columns: 1fr; }
}

.ms-panel {
  background: var(--ms-card);
  border: 1px solid var(--ms-line);
  border-radius: 14px;
  padding: 16px;
}

.ms-panel h2 {
  font-size: 15px;
  color: var(--ms-ink);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ms-panel h2 .ms-tag {
  font-size: 11px;
  color: var(--ms-accent);
  background: #eaf3fb;
  border: 1px solid #cfe4f5;
  padding: 2px 8px;
  border-radius: 999px;
}

.ms-file {
  display: inline-block;
  border: 1px dashed var(--ms-accent);
  color: var(--ms-accent);
  background: #f5faff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 12px;
}
.ms-file input { display: none; }

.ms-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0e1726;
}
.ms-stage canvas { display: block; max-width: 100%; height: auto; touch-action: none; }

.ms-crop {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(8, 18, 32, 0.55);
  cursor: move;
  box-sizing: border-box;
}
.ms-crop .ms-handle {
  position: absolute;
  width: 16px; height: 16px;
  background: #fff;
  border: 2px solid var(--ms-accent);
  border-radius: 50%;
}
.ms-crop .ms-h-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.ms-crop .ms-h-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.ms-crop .ms-h-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.ms-crop .ms-h-se { right: -9px; bottom: -9px; cursor: nwse-resize; }

.ms-hint {
  font-size: 12px;
  color: #6b8299;
  margin: 10px 0;
  line-height: 1.6;
}

.ms-btn {
  border: none;
  background: var(--ms-accent);
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  margin: 4px 6px 4px 0;
}
.ms-btn.ghost { background: #eef5fb; color: var(--ms-accent); border: 1px solid #cfe4f5; }
.ms-btn:active { transform: translateY(1px); }

.ms-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.ms-field { display: flex; flex-direction: column; font-size: 12px; color: #5a7790; gap: 4px; }
.ms-field input {
  width: 64px; padding: 6px 8px; border: 1px solid var(--ms-line);
  border-radius: 8px; font-size: 14px; color: var(--ms-ink);
}

.ms-swatches { display: flex; gap: 8px; }
.ms-swatch {
  width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; position: relative;
}
.ms-swatch.on { border-color: var(--ms-ink); box-shadow: 0 0 0 2px #fff inset; }
.ms-swatch span {
  position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: #5a7790; white-space: nowrap;
}

.ms-grid {
  display: grid;
  gap: 3px;
  margin: 10px 0;
  background: #0e1726;
  padding: 3px;
  border-radius: 8px;
  width: fit-content;
  max-width: 100%;
}
.ms-cell {
  border-radius: 4px;
  cursor: pointer;
  transition: transform .08s;
}
.ms-cell:active { transform: scale(0.92); }
.ms-cell.win { outline: 3px solid #fff; }

.ms-steps { margin-top: 10px; }
.ms-step {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f1f7fc; border: 1px solid var(--ms-line);
  border-radius: 999px; padding: 5px 12px; margin: 4px 6px 4px 0; font-size: 13px; color: var(--ms-ink);
}
.ms-step b { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }
.ms-step i { font-style: normal; color: #8aa3ba; margin-left: 2px; }

.ms-msg { font-size: 13px; color: #356; margin: 8px 0; }
.ms-msg.warn { color: #c0392b; }
.ms-msg.ok { color: #1f8a4c; }

.ms-empty { color: #9bb0c4; font-size: 13px; padding: 24px 0; text-align: center; }

.ms-grid-preview { display: grid; gap: 2px; width: fit-content; max-width: 100%; }
.ms-cell-preview { border-radius: 3px; }

.ms-replay-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.ms-progress { font-size: 13px; color: #5a7790; }

.ms-palette-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #5a7790; margin-top: 6px; }
.ms-palette-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }
