:root {
  --bg: #f0f2f5;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #1677ff;
  --blue-dark: #0958d9;
  --blue-soft: #e6f4ff;
  --red: #ff4d4f;
  --green: #16a34a;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 22px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.language-chip {
  min-width: 84px;
  padding: 8px 14px;
  border: 1px solid #d9e8ff;
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.08);
}

.panel {
  min-height: 560px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

#productMode {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: #fff;
  color: #4b5563;
  cursor: default;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: #edf2f7;
  color: #6b7280;
  font-size: 13px;
  font-weight: 750;
}

.step strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.step.is-active {
  border-color: var(--blue);
  background: #f5faff;
  color: var(--blue);
}

.step.is-active span {
  background: var(--blue);
  color: #fff;
}

.notice {
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #d9e8ff;
  border-radius: 10px;
  background: #f5faff;
  color: var(--blue-dark);
  line-height: 1.5;
}

.notice.is-error {
  border-color: #ffccc7;
  background: #fff2f0;
  color: #cf1322;
}

.notice.is-success {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #237804;
}

.stage {
  display: none;
}

.stage.is-active {
  display: block;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: #374151;
  font-size: 14px;
  font-weight: 650;
}

textarea {
  width: 100%;
  min-height: 116px;
  padding: 12px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  outline: none;
  resize: vertical;
  color: var(--text);
  line-height: 1.55;
  background: #fff;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.actions,
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quick-links {
  margin-bottom: 14px;
}

.primary,
.secondary {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 650;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

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

.primary:hover {
  background: var(--blue-dark);
}

.secondary {
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #374151;
}

.secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.primary:disabled,
.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.account-preview {
  min-height: 42px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #d9e8ff;
  border-radius: 10px;
  background: #f5faff;
  color: #334155;
  line-height: 1.5;
}

.summary {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.summary div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  min-height: 44px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #edf0f3;
  border-radius: 10px;
  background: #fafafa;
}

.summary dt {
  color: var(--muted);
  font-size: 13px;
}

.summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.footer {
  padding: 20px 0 0;
  color: #8a94a6;
  text-align: center;
  font-size: 13px;
}

.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  gap: 12px;
  background: rgba(240, 242, 245, 0.62);
  backdrop-filter: blur(4px);
  color: var(--blue-dark);
  font-weight: 700;
}

.loader {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(22, 119, 255, 0.16);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(100%, 400px);
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}

.modal h2 {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.4;
}

.modal p {
  margin: 0 0 16px;
  color: #111827;
  line-height: 1.65;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: transparent;
  color: #7b8494;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .app {
    width: min(100% - 20px, 560px);
    padding-top: 20px;
  }

  .hero {
    display: grid;
    gap: 14px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .language-chip {
    width: max-content;
  }

  .panel {
    padding: 18px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .summary div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .primary,
  .secondary {
    width: 100%;
  }

  .modal-actions {
    display: grid;
  }
}
