* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background: #101014;
  color: #e8e8ea;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(16, 16, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #26262e;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.topbar .sub {
  font-size: 12px;
  color: #8a8a96;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage {
  border-radius: 14px;
  overflow: hidden;
  background: #1a1a22;
  border: 1px solid #26262e;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  cursor: pointer;
  user-select: none;
}

.empty-icon {
  font-size: 52px;
  margin-bottom: 14px;
}

.empty-state p {
  color: #a0a0ac;
  margin-bottom: 18px;
  font-size: 15px;
}

.preview-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  background: #000;
}

.preview-wrap canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.panel {
  border-radius: 14px;
  background: #1a1a22;
  border: 1px solid #26262e;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

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

.tip {
  font-size: 12px;
  color: #8a8a96;
  margin-bottom: 14px;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field span {
  font-size: 13px;
  color: #b8b8c2;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #33333e;
  background: #101014;
  color: #f0f0f2;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus {
  border-color: #4a90d9;
}

.actions {
  margin-top: 18px;
}

.btn-primary {
  background: #2f6fce;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary:hover {
  background: #3a7fe0;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: #9ab8e8;
  border: 1px solid #3a4a66;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #20283a;
}

.btn-block {
  width: 100%;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 30, 40, 0.95);
  color: #f0f0f2;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
  max-width: 80vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  main {
    padding: 12px;
  }

  .field-row {
    flex-direction: column;
    gap: 12px;
  }
}
