:root {
  color-scheme: light;
  --accent: #1459ed;
  --accent-hover: #0b49cf;
  --border: #c7ced9;
  --muted: #687385;
  --text: #111827;
  --danger: #c0262d;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: #fff;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: #fff;
  display: flex;
  flex-direction: column;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 20px;
  flex: 1;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.mark {
  width: 38px;
  height: 38px;
  color: var(--accent);
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
}

textarea,
input {
  width: 100%;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  display: block;
  min-height: 180px;
  resize: vertical;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  line-height: 1.65;
}

textarea::placeholder,
input::placeholder {
  color: #929baa;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(20 89 237 / 14%);
}

.helper,
.error,
.status {
  font-size: 13px;
  line-height: 1.5;
}

.helper {
  margin: 8px 0 12px;
  color: var(--muted);
}

.error {
  margin: -4px 0 12px;
  color: var(--danger);
  font-weight: 600;
}

button {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

button:focus-visible {
  outline: 3px solid rgb(20 89 237 / 24%);
  outline-offset: 2px;
}

.primary {
  width: 100%;
  color: #fff;
  background: var(--accent);
}

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

.result {
  margin-top: 20px;
}

.result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
}

.result-row input {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
}

.secondary {
  color: var(--accent);
  background: #fff;
  border-color: var(--border);
}

.secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.secondary:disabled {
  color: #9ba3af;
  background: #f5f6f8;
  cursor: not-allowed;
}

.status {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--muted);
}

footer {
  padding: 14px 24px 16px;
  color: var(--muted);
  border-top: 1px solid #e8ebf0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 32px, 520px);
    padding: 24px 0 20px;
  }

  .header {
    justify-content: flex-start;
    gap: 9px;
    margin-bottom: 24px;
  }

  .mark {
    width: 34px;
    height: 34px;
  }

  h1 {
    font-size: clamp(25px, 7.4vw, 32px);
    white-space: nowrap;
  }

  .header p {
    margin-top: 4px;
    font-size: 13px;
    text-align: left;
  }

  textarea {
    min-height: 220px;
    padding: 13px;
    font-size: 13px;
  }

  .helper {
    margin-bottom: 12px;
  }

  .result {
    margin-top: 20px;
  }

  .result-row {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
  }

  button,
  .result-row input {
    min-height: 44px;
  }

  footer {
    padding-block: 20px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}