:root {
  color-scheme: light;
  --background: #f7f8fb;
  --surface: #ffffff;
  --text: #17191f;
  --muted: #737884;
  --border: #dfe3ea;
  --accent: #2864f0;
  --accent-dark: #174ed0;
  --coral: #f26f60;
  --shadow: 0 24px 70px rgba(42, 52, 72, 0.09);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(40, 100, 240, 0.055), transparent 34rem),
    var(--background);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 52px;
}

.hero {
  text-align: center;
}

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  margin: 0 auto 22px;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px solid var(--accent);
  border-radius: 9px;
  transform: rotate(-5deg);
}

.brand-mark span {
  position: absolute;
  width: 8px;
  height: 8px;
  right: -5px;
  top: -5px;
  border-radius: 2px;
  background: var(--coral);
  box-shadow: -22px 27px 0 -2px #80a5ff;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.06em;
  font-weight: 780;
}

.hero p {
  margin: 15px 0 36px;
  color: var(--muted);
  font-size: 1rem;
}

.workspace {
  position: relative;
  padding: 28px;
  border: 1px solid rgba(223, 227, 234, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.editor-heading label {
  font-size: 0.86rem;
  font-weight: 700;
}

.text-button {
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}

.text-button:hover {
  color: #d94c41;
}

textarea {
  display: block;
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: none;
  background: #fbfcfe;
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1.8;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(40, 100, 240, 0.11);
}

textarea::placeholder {
  color: #a0a5af;
}

.stats {
  display: flex;
  gap: 42px;
  padding: 20px 4px 18px;
}

.stats div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.stats strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.stats span {
  color: var(--muted);
  font-size: 0.78rem;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.action-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: #383d47;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.action-button:hover {
  border-color: #bfc8d8;
  background: #f9fafc;
  transform: translateY(-1px);
}

.action-button:active {
  transform: translateY(0);
}

.action-button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(40, 100, 240, 0.22);
  outline-offset: 3px;
}

.action-button > span {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.action-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.action-button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 9px 22px rgba(40, 100, 240, 0.2);
}

.action-button--primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 0;
  color: #8a8f99;
  font-size: 0.76rem;
}

.privacy-note svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #55a47b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: -18px;
  z-index: 2;
  padding: 9px 14px;
  border-radius: 999px;
  background: #17191f;
  color: #fff;
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

  .hero p {
    margin-bottom: 26px;
  }

  .workspace {
    padding: 18px;
    border-radius: 18px;
  }

  textarea {
    min-height: 235px;
    padding: 17px;
  }

  .stats {
    justify-content: space-between;
    gap: 10px;
  }

  .actions {
    grid-template-columns: 1fr 1fr;
  }

  .action-button--primary {
    grid-column: 1 / -1;
  }
}

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