:root {
  color-scheme: light;
  --ink: #211a36;
  --muted: #655d75;
  --violet: #613ac6;
  --violet-dark: #4d28a6;
  --violet-soft: #f0eaff;
  --surface: #fff;
  --line: #e6dfef;
  --background: #f8f6fc;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1080px, calc(100% - 56px));
  min-height: 70px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  font-weight: 730;
  letter-spacing: .03em;
  text-decoration: none;
}

.brand-mark, .customer-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  background: var(--violet);
  color: white;
}

.workspace { width: min(1080px, calc(100% - 56px)); margin: auto; padding: 56px 0 64px; }
.intro { margin-bottom: 30px; }
h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.19;
  letter-spacing: -.035em;
  font-weight: 770;
}

.intro p, .customer-heading p, .status-card p {
  margin-top: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.panels {
  display: grid;
  grid-template-columns: 1.07fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.panel {
  min-width: 0;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 14px 36px #2c174a07;
}

.panel h2 { font-size: 1.18rem; line-height: 1.4; font-weight: 730; }
.settings form { margin-top: 25px; }
.field { min-width: 0; display: grid; gap: 9px; }
.field > span { font-size: .9rem; font-weight: 650; }
.field input, .scan-link {
  width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 9px 12px;
  border: 1px solid #dcd3e8;
  border-radius: 9px;
  background: #fcfbfe;
  color: var(--ink);
  font-size: 1rem;
}

.field input:hover { border-color: #aa98cf; }
.field input::placeholder { color: #746b84; }
.link-settings { min-width: 0; margin: 0 0 23px; padding: 0; border: 0; }
.link-settings legend { padding: 0; font-size: 1rem; font-weight: 730; }
.link-help { margin: 6px 0 13px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.check-field { display: flex; align-items: center; gap: 8px; width: fit-content; margin-bottom: 13px; font-size: .9rem; cursor: pointer; }
.check-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--violet); }
.link-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-help {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 12px 0 22px;
  font-size: .875rem;
  line-height: 1.5;
  color: var(--muted);
}

.field-help svg { flex: none; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 680;
  line-height: 1.35;
}

.button svg { flex: none; }
.primary { width: 100%; margin-top: 6px; color: white; background: var(--violet); }
.field + .primary, .field + .form-feedback + .primary { margin-top: 23px; }
.primary:hover { background: var(--violet-dark); }
.primary:disabled { opacity: .7; }
.form-feedback { margin: 12px 0 7px; color: #aa2647; line-height: 1.5; }
.preview { display: flex; flex-direction: column; }
.preview-heading { display: flex; min-height: 27px; justify-content: space-between; align-items: center; gap: 12px; }
.tag { font-size: .75rem; font-weight: 750; letter-spacing: .05em; background: var(--violet-soft); color: var(--violet-dark); border-radius: 6px; padding: 4px 8px; }

.preview-area {
  display: grid;
  place-items: center;
  flex: 1 0 auto;
  min-height: 257px;
  margin: 19px 0 16px;
  padding: 16px;
  border: 1px dashed #d6c9ee;
  border-radius: 13px;
  text-align: center;
  background: #faf7ff;
}

.empty-state { display: grid; justify-items: center; gap: 16px; }
.empty-state p { color: var(--muted); font-size: .9rem; }
.scan-frame {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  border: 1px solid #e8ddfc;
  border-radius: 24px;
  background: var(--violet-soft);
  color: #805acb;
}

#qr-canvas { display: block; width: min(218px, 100%); height: auto; aspect-ratio: 1; border-radius: 7px; }
.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.secondary { border-color: #dfd3fa; background: #f9f5ff; color: var(--violet-dark); font-size: .9rem; }
.secondary:hover:enabled { background: var(--violet-soft); }
.secondary:disabled { border-color: #e9e3ef; background: #faf8fc; color: #716982; }
.preview-feedback { margin-top: 12px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.scan-link { margin-top: 8px; font-size: .875rem; }

.customer-page {
  background: radial-gradient(ellipse at top, #eee5fc 0%, #f8f6fc 65%);
  padding: 65px 24px;
}

.customer-shell { max-width: 710px; margin: auto; }
.customer-heading { margin-bottom: 30px; }
.customer-mark { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 21px; }
.customer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.customer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 7px 20px #2c174a06;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.customer-link:hover, .customer-link:active { border-color: #b6a0e6; background: #fcfaff; }

.entry-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 43px;
  height: 43px;
  border-radius: 11px;
  color: var(--violet-dark);
  background: var(--violet-soft);
}

.entry-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linejoin: round; stroke-linecap: round; }
.entry-note { display: block; color: var(--muted); margin-top: 2px; font-size: .875rem; font-weight: 500; }
.status-card { max-width: 540px; margin: auto; padding: 30px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.status-card h1 { font-size: clamp(1.65rem, 6vw, 2.25rem); }

@media (max-width: 860px) {
  .panels { grid-template-columns: 1fr; }
  .workspace { max-width: 620px; }
}

@media (max-width: 540px) {
  .header-inner, .workspace { width: calc(100% - 32px); }
  .header-inner { min-height: 62px; }
  .workspace { padding: 35px 0 45px; }
  .intro { margin-bottom: 23px; }
  .panel { padding: 20px; border-radius: 15px; }
  .panels { gap: 15px; }
  .date-fields, .link-fields { grid-template-columns: 1fr; }
  .preview-area { min-height: 241px; }
  .preview-actions { gap: 8px; }
  .button { padding-inline: 9px; }
  .customer-page { padding: 32px 18px; }
  .customer-heading { margin-bottom: 23px; }
  .customer-grid { grid-template-columns: 1fr; gap: 9px; }
  .customer-link { min-height: 67px; padding: 10px 13px; }
  .status-card { padding: 24px; }
}
