:root {
  --ink: #26322d;
  --ink-soft: #52605a;
  --muted: #7b8680;
  --paper: #f3f2ed;
  --surface: #fbfaf7;
  --surface-strong: #ffffff;
  --sage: #718073;
  --sage-pale: #e4e8e2;
  --clay: #8a5f52;
  --clay-pale: #f2e7e2;
  --line: #d7dad4;
  --line-strong: #bdc4bc;
  --danger: #9b4439;
  --success: #456a52;
  --shadow: 0 20px 50px rgba(38, 50, 45, 0.09);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 1.8;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

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

.button:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible,
.field select:focus-visible,
.search-field input:focus-visible {
  outline: 3px solid rgba(113, 128, 115, 0.28);
  outline-offset: 2px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.button-primary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.button-primary:hover {
  background: #18221e;
  border-color: #18221e;
}

.button-secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

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

.button-quiet {
  min-height: 40px;
  padding: 8px 12px;
  color: var(--ink-soft);
  background: transparent;
  border-color: transparent;
}

.button-quiet:hover {
  color: var(--ink);
  background: var(--sage-pale);
}

.button-danger {
  color: var(--danger);
  background: transparent;
  border-color: rgba(155, 68, 57, 0.28);
}

.button-danger:hover {
  background: #f8ece9;
  border-color: var(--danger);
}

.toast {
  position: fixed;
  z-index: 20;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  box-shadow: 0 14px 36px rgba(20, 30, 25, 0.2);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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