:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #d9dee8;
  --line-soft: #edf1f5;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --green: #15803d;
  --red: #b42318;
  --amber: #b54708;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
}

.after-card {
  width: min(1480px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.page-head {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line-soft);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 800;
}

h2 {
  font-size: 18px;
  font-weight: 800;
}

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

.stock-pill {
  flex: 0 0 auto;
  min-width: 190px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.stock-pill.paused {
  border-color: rgba(181, 71, 8, 0.22);
  background: #fffaeb;
  color: var(--amber);
}

.service-notice {
  margin: 18px 30px 0;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 14px;
  line-height: 1.45;
}

.service-notice.warn {
  border-color: rgba(181, 71, 8, 0.22);
  background: #fffaeb;
  color: var(--amber);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  padding: 26px 30px 24px;
}

.input-panel,
.output-panel {
  min-width: 0;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 1px solid #cfd6e3;
  border-radius: 6px;
  padding: 16px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#replacementOutput {
  background: #fbfcfe;
}

.action-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  font-weight: 800;
}

.btn {
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  font-size: 15px;
}

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

.btn.primary:hover {
  background: var(--primary-strong);
}

.btn.secondary {
  border-color: var(--line);
  background: #fff;
  color: #344054;
}

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.output-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn.compact {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
}

.status-line {
  min-height: 50px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 15px;
}

.status-line.success {
  border-color: rgba(21, 128, 61, 0.2);
  background: #ecfdf3;
  color: var(--green);
}

.status-line.warn {
  border-color: rgba(181, 71, 8, 0.22);
  background: #fffaeb;
  color: var(--amber);
}

.status-line.error {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff1f0;
  color: var(--red);
}

.verification-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 22px;
  align-items: stretch;
  margin: 0 30px 30px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.verification-copy p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.verification-form textarea {
  min-height: 124px;
}

.verification-result {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 184px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.verification-label,
.status-note {
  color: var(--muted);
  font-size: 13px;
}

.status-note[data-tone="success"] {
  color: var(--green);
  font-weight: 700;
}

.status-note[data-tone="warn"] {
  color: var(--amber);
  font-weight: 700;
}

.status-note[data-tone="error"] {
  color: var(--red);
  font-weight: 700;
}

.verification-code {
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px dashed #cfd6e3;
  border-radius: 8px;
  background: #f8fafc;
  color: #101828;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0;
}

.verification-code.active {
  border-color: rgba(21, 128, 61, 0.28);
  background: #ecfdf3;
  color: var(--green);
}

.verification-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 780px) {
  .page-shell {
    place-items: stretch;
    padding: 14px;
  }

  .page-head,
  .work-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .service-notice {
    margin: 14px 14px 0;
  }

  .page-head,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .page-head {
    display: grid;
  }

  .stock-pill {
    width: 100%;
  }

  .verification-card {
    grid-template-columns: 1fr;
    margin: 0 14px 14px;
    padding: 16px;
  }

  .verification-code {
    font-size: 36px;
  }

  .output-head,
  .output-tools {
    align-items: stretch;
  }

  .output-tools {
    width: 100%;
  }

  .btn.compact {
    flex: 1;
  }
}
