:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #607080;
  --line: #d7dde3;
  --focus: #1677ff;
  --danger: #d93025;
  --danger-bg: #fff5f5;
  --button: #1677ff;
  --button-hover: #0f63d6;
  --success: #0f7b4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

.page-shell {
  min-height: 100vh;
  padding: 32px 16px;
}

.form-panel {
  width: min(880px, 100%);
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.form-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.form-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 650;
}

.form-header p {
  margin: 0;
  color: var(--muted);
}

.field,
.agreement {
  margin-bottom: 18px;
}

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

.field-grid.compact {
  align-items: start;
}

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--focus);
  outline: 2px solid rgb(22 119 255 / 18%);
  outline-offset: 1px;
}

input[readonly] {
  background: #eef2f6;
}

.field.invalid input,
.field.invalid select {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field-error {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 18px;
}

.file-meta,
.field-help {
  min-height: 18px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.field-help {
  color: var(--success);
}

.field-help.critical-help {
  color: var(--danger);
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
}

.radio-group {
  display: flex;
  gap: 24px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-weight: 400;
}

.radio-group input[type="radio"] {
  width: auto;
  min-height: 0;
  margin: 0;
}

.input-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 10px;
}

.captcha-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
}

.captcha-control button {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.captcha-control img {
  display: block;
  width: 128px;
  height: 44px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

#smsCodeButton {
  background: #eef4ff;
  color: #1756a9;
  border: 1px solid #b9cdf5;
}

#smsCodeButton:disabled {
  cursor: not-allowed;
  color: #718096;
  background: #eef1f4;
  border-color: #d4dbe3;
}

.agreement {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.agreement input {
  width: 16px;
  min-height: 16px;
}

.submit-button {
  width: 100%;
  background: var(--button);
  color: #fff;
  font-weight: 650;
}

.submit-button:hover {
  background: var(--button-hover);
}

.status-actions {
  margin-top: 16px;
}

.secondary-button {
  width: 100%;
  background: var(--panel);
  color: var(--button);
  border: 1px solid var(--button);
  font-weight: 650;
}

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

.hidden {
  display: none;
}

.service-intro-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.service-detail-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 650;
  color: var(--text);
}

.service-detail p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.6;
}

.service-detail p:last-child {
  margin-bottom: 0;
}

.service-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.support-qr-box {
  width: 160px;
  min-height: 160px;
  margin-top: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
}

.support-qr-image {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
}

.support-chat-panel {
  margin-top: 18px;
}

.support-chat-messages {
  display: flex;
  min-height: 112px;
  max-height: 320px;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.support-chat-empty {
  margin: auto 0;
  color: var(--muted);
  text-align: center;
}

.support-chat-message {
  max-width: 86%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-chat-message.customer {
  align-self: flex-end;
  border-color: #b9cdf5;
  background: #eef4ff;
}

.support-chat-message.agent {
  align-self: flex-start;
}

.support-chat-form textarea {
  display: block;
  width: 100%;
  resize: vertical;
}

.support-chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.support-chat-footer .field-help {
  margin: 0;
}

.cashier-summary,
.success-summary,
.status-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.cashier-summary span,
.success-summary span {
  color: var(--muted);
  font-weight: 600;
}

.cashier-summary strong,
.success-summary strong,
.status-summary strong {
  font-size: 30px;
  line-height: 1.2;
}

.payment-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.payment-actions button {
  background: #eef4ff;
  color: #1756a9;
  border: 1px solid #b9cdf5;
  font-weight: 650;
}

.payment-actions .dev-payment-button {
  background: #f0fbf6;
  color: #0f6b45;
  border-color: #9bd8bb;
}

.qr-box {
  width: 220px;
  min-height: 220px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
}

.qr-image {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: contain;
  background: #fff;
  image-rendering: pixelated;
}

.payment-status {
  min-height: 22px;
  margin: 0;
  text-align: center;
  color: var(--muted);
}

.payment-status.success {
  color: var(--success);
  font-weight: 650;
}

@media (max-width: 720px) {
  .form-panel {
    padding: 20px;
  }

  .field-grid,
  .payment-actions,
  .captcha-control,
  .input-button {
    grid-template-columns: 1fr;
  }

  .captcha-control button,
  .captcha-control img {
    width: 100%;
  }

  .cashier-summary,
  .success-summary,
  .status-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .support-chat-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
