:root {
  --paper: #f5f3ed;
  --paper-2: #ece9df;
  --ink: #171815;
  --muted: #6c6d67;
  --line: rgba(23, 24, 21, .12);
  --green: #1f7a5a;
  --green-2: #dff1e9;
  --orange: #d36b32;
  --yellow: #f0c865;
  --blue: #457b9d;
  --white: #fffdfa;
  --shadow: 0 24px 70px rgba(41, 39, 32, .12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 0%, #fff 0, transparent 28%), var(--paper);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[data-copy-latex] {
  position: relative;
  border-radius: 6px;
  cursor: copy;
  transition: background-color .16s ease, box-shadow .16s ease;
}

[data-copy-latex]:hover,
[data-copy-latex]:focus-visible {
  background-color: rgba(31, 122, 90, .1);
  box-shadow: 0 0 0 2px rgba(31, 122, 90, .22);
  outline: none;
}

[data-copy-latex].latex-display::after {
  content: "复制 LaTeX";
  position: absolute;
  z-index: 5;
  top: 6px;
  right: 7px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(20, 54, 46, .9);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity .16s ease, transform .16s ease;
}

[data-copy-latex].latex-display:hover::after,
[data-copy-latex].latex-display:focus-visible::after,
[data-copy-latex].latex-display.formula-copied::after {
  opacity: 1;
  transform: translateY(0);
}

[data-copy-latex].latex-display.formula-copied::after {
  content: attr(data-copy-state);
  background: var(--green);
}

[data-copy-latex].latex-inline:hover,
[data-copy-latex].latex-inline:focus-visible {
  text-decoration: underline dotted rgba(31, 122, 90, .75);
  text-underline-offset: .22em;
}

@media (prefers-reduced-motion: reduce) {
  [data-copy-latex],
  [data-copy-latex].latex-display::after {
    transition: none;
  }
}

.hidden {
  display: none !important;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, .2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
