:root {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: #18374f;
  background: #f0f8ff;
  font-synthesis: none;
  --accent: #087fca;
  --muted: #607d94;
  --line: #dceaf5;
  --paper: #fff;
  --soft: #edf7ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 12% 0%, #dff2ff 0%, transparent 45%),
    linear-gradient(135deg, #f5fbff, #eff7ff);
}
button,
input,
textarea,
select {
  font: inherit;
}
a {
  color: inherit;
}
button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 16px;
  transition:
    background 0.16s,
    color 0.16s,
    border-color 0.16s;
}
button:hover:enabled {
  background: #edf7ff;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #7dc8f5;
  outline-offset: 3px;
}
button.primary {
  background: linear-gradient(110deg, #078ad2, #087fca);
  border-color: #087fca;
  box-shadow: 0 4px 12px #078ad21a;
  color: white;
  font-weight: 600;
}
button.primary:hover:enabled {
  background: #0669ae;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: inherit;
}
textarea {
  resize: vertical;
  width: 100%;
  min-height: 112px;
  line-height: 1.6;
  padding: 14px 36px 14px 16px;
  font-size: 15px;
  display: block;
}
textarea:focus {
  border-color: #46a9e6;
}
textarea::placeholder,
input::placeholder {
  color: #91a8ba;
}
select {
  padding: 10px;
  min-height: 44px;
  font-size: 13px;
}
input {
  padding: 12px;
  width: 100%;
}
[hidden] {
  display: none !important;
}
.site-header {
  max-width: 1120px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 29px 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 1px;
}
.brand-mark {
  font-size: 42px;
  line-height: 1;
  color: var(--accent);
}
.brand-sub {
  font-family: monospace;
  display: block;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 1.7px;
  color: var(--muted);
  margin-top: 5px;
}
.site-header nav {
  display: flex;
  gap: 26px;
  font-size: 13px;
  color: #50728d;
}
.site-header nav a {
  text-decoration: none;
}
.site-header nav a:hover {
  text-decoration: underline;
}
main {
  max-width: 1060px;
  margin: 30px auto 0;
  padding: 0 32px;
}
h1 {
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -1px;
  line-height: 1.3;
  margin: 0;
  font-weight: 650;
}
h1 span {
  color: #147fc0;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.editor,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  background: #fff;
  box-shadow:
    0 8px 32px #3283bf08,
    0 1px 3px #3283bf04;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
h2 {
  font-size: 16px;
  margin: 0;
  font-weight: 600;
}
.step {
  font: 11px monospace;
  color: #4688b1;
  border: 1px solid #d6ebfa;
  background: #f0f9ff;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #edf5fc;
  padding: 4px;
  border-radius: 10px;
  margin: 24px 0;
}
.tabs button {
  border: 0;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  min-height: 40px;
  padding: 9px;
}
.tabs button[aria-selected='true'] {
  background: white;
  color: var(--accent);
  box-shadow: 0 1px 5px #126aa512;
}
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
  gap: 12px;
}
.inline-button {
  border: 0;
  padding: 4px 0;
  border-radius: 3px;
  font-size: 12px;
  color: #167bb9;
  background: none !important;
  text-underline-offset: 4px;
}
.inline-button:hover:enabled {
  text-decoration: underline;
}
.url-wrap {
  position: relative;
}
.clear-input {
  position: absolute;
  right: 6px;
  top: 7px;
  padding: 3px;
  width: 30px;
  height: 30px;
  border: 0;
  font-size: 22px;
  color: #7c9ab0;
}
.field-hint {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin: 9px 0 0;
}
.generate {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 21px;
  min-height: 48px;
  font-size: 14px;
}
.generate span:last-child {
  font-size: 20px;
  font-weight: 400;
}
.error-box {
  padding: 12px;
  background: #fff3ed;
  border: 1px solid #f0d6c6;
  border-radius: 9px;
  margin-top: 15px;
  font-size: 12px;
  line-height: 1.7;
  color: #9d4933;
}
.error-box p {
  margin: 0;
}
.error-box button {
  color: inherit;
}
.customize {
  border-top: 1px solid #e6eff7;
  margin-top: 28px;
  padding-top: 24px;
}
.optional {
  font-size: 11px;
  font-weight: 400;
  color: #8298aa;
  margin-left: auto;
}
.avatar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0;
}
.avatar-control {
  display: flex;
  gap: 13px;
  align-items: center;
  text-align: left;
  padding: 0;
  border: 0;
  background: none !important;
}
.avatar-control strong {
  display: block;
  font-weight: 500;
  font-size: 13px;
}
.avatar-control small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
#avatar-preview {
  border: 1px dashed #a3cde8;
  background: #f1f9ff;
  color: #4d99c9;
  width: 48px;
  height: 48px;
  font-size: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
}
#avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.size-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  font-size: 13px;
}
.size-row select {
  width: 205px;
  max-width: 65%;
}
.settings {
  border-top: 1px solid #e9f1f8;
  margin-top: 20px;
  padding-top: 14px;
}
.settings summary {
  font-size: 12px;
  padding: 7px 0;
  color: #547b98;
}
.settings summary span {
  float: right;
  font-size: 11px;
  color: #7896ac;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.settings-grid label {
  font-size: 12px;
  min-width: 0;
}
.settings-grid select {
  width: 100%;
  margin-top: 8px;
}
.result-panel {
  background: #ffffff;
  position: sticky;
  top: 24px;
}
.result-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.result-badge {
  font-size: 10px;
  border-radius: 20px;
  padding: 6px 9px;
  background: #edf6fd;
  color: #6e91ac;
  white-space: nowrap;
}
.result-badge[data-state='ready'] {
  color: #0875b3;
  background: #e6f5ff;
}
.result-badge[data-state='error'] {
  color: #a66342;
  background: #f8ebe2;
}
.preview-stage {
  padding: 17px;
  background: radial-gradient(#cce1f2 0.7px, transparent 0.7px);
  background-size: 12px 12px;
  border: 1px solid #e0eef9;
  border-radius: 14px;
  margin: 24px 0 0;
}
.preview {
  width: 100%;
  aspect-ratio: 1;
  background: white;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: opacity 0.2s;
}
.preview img {
  width: 100%;
  height: auto;
  display: block;
  padding: 6px;
}
.preview.stale {
  opacity: 0.3;
}
.empty-state {
  text-align: center;
  padding: 20px;
  color: #6489a5;
}
.empty-state strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-top: 22px;
}
.empty-state p {
  font-size: 11px;
  line-height: 1.7;
  color: #829cb0;
}
.empty-art {
  border: 1px solid #d7eaf8;
  border-radius: 50%;
  width: 110px;
  height: 110px;
  margin: auto;
  display: grid;
  place-items: center;
  outline: 1px dashed #c9e3f5;
  outline-offset: 12px;
}
.empty-art span {
  font-size: 74px;
  font-weight: 200;
  color: #b5d9f2;
}
.result-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #6f8da4;
  margin-top: 13px;
  min-height: 14px;
  gap: 10px;
}
.result-status {
  min-height: 20px;
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
  color: #527c99;
  margin: 10px 0 18px;
}
.export > button {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
}
.export > button span {
  font-size: 10px;
  margin-left: 7px;
  font-weight: 400;
  opacity: 0.7;
}
.secondary-exports {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.secondary-exports button {
  min-height: 44px;
  font-size: 12px;
}
.drop-zone {
  width: 100%;
  padding: 22px 12px 20px;
  border: 1px dashed #aad0eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f4faff;
  min-height: 190px;
}
.drop-zone svg {
  width: 35px;
  height: 35px;
  color: #3e96ca;
  margin-bottom: 13px;
}
.drop-zone strong {
  font-size: 13px;
  font-weight: 500;
}
.drop-zone span {
  font-size: 11px;
  color: #7192ac;
  margin-top: 9px;
}
.drop-zone small {
  font-size: 10px;
  color: #7e9bb0;
  margin-top: 10px;
}
.drop-zone.dragging {
  background: #e5f5ff;
  border-color: var(--accent);
}
.qr-source {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 0 0;
  font-size: 11px;
  color: #157bb8;
}
.qr-source > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.success-dot {
  background: #22a4e5;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
dialog {
  border: 1px solid var(--line);
  padding: 26px;
  border-radius: 18px;
  color: inherit;
  width: min(440px, calc(100% - 32px));
  box-shadow: 0 20px 90px #165d9630;
}
dialog::backdrop {
  background: #173e6255;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.icon-button {
  border: 0;
  font-size: 23px;
  padding: 0;
  width: 32px;
  height: 32px;
}
dialog p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}
dialog .field-label {
  margin-top: 22px;
}
.service-note {
  background: #edf8ff;
  padding: 12px;
  border-radius: 8px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.dialog-actions button {
  min-width: 80px;
}
.skip-link {
  position: absolute;
  top: -100px;
  background: white;
  padding: 12px;
  z-index: 10;
}
.skip-link:focus {
  top: 8px;
  left: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 760px) {
  .site-header {
    padding: 20px;
  }
  .brand {
    font-size: 17px;
  }
  .brand-mark {
    font-size: 36px;
  }
  .brand-sub {
    font-size: 7px;
  }
  .site-header nav {
    font-size: 12px;
    gap: 14px;
  }
  .algorithm-link {
    display: none;
  }
  main {
    padding: 0 18px;
    margin-top: 22px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .editor,
  .result-panel {
    padding: 23px;
    border-radius: 16px;
  }
  .result-panel {
    position: static;
  }
  .preview-stage {
    max-width: 390px;
    width: 100%;
    margin: 20px auto 0;
  }
  .preview {
    max-height: 390px;
  }
  .result-badge {
    font-size: 10px;
  }
  .generate {
    min-height: 48px;
  }
  .tabs button {
    min-height: 44px;
  }
  .inline-button {
    min-height: 28px;
  }
  .result-status {
    margin-top: 8px;
  }
  .size-row select {
    max-width: 68%;
  }
}
@media (max-width: 360px) {
  .editor,
  .result-panel {
    padding: 18px;
  }
  .brand-sub {
    letter-spacing: 1px;
  }
  .site-header nav {
    font-size: 11px;
  }
  .preview-stage {
    padding: 10px;
  }
  .result-heading {
    gap: 5px;
  }
  h2 {
    font-size: 14px;
  }
  .optional {
    font-size: 10px;
  }
  .settings summary span {
    font-size: 10px;
  }
  .size-row select {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

main {
  padding-bottom: 40px;
}
.service-setting {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
