:root {
  --paper: #f7f5fa;
  --paper-strong: #fffdfb;
  --paper-muted: #eeecf5;
  --ink: #24243a;
  --ink-soft: #626377;
  --ink-faint: #6b6c80;
  --line: rgba(68, 64, 102, 0.16);
  --line-strong: rgba(68, 64, 102, 0.28);
  --blue: #6576de;
  --blue-deep: #5262c8;
  --blue-soft: #e5e7fb;
  --lavender: #c9c7e8;
  --tea: #c77c4a;
  --tea-soft: #f4e3d7;
  --success: #34785f;
  --danger: #b64655;
  --shadow: 0 24px 70px rgba(50, 47, 86, 0.12);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --header-height: 76px;
  --content-width: 1320px;
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Noto Sans SC", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-out 220ms ease both;
}

::view-transition-new(root) {
  animation: page-in 420ms cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  animation: app-enter 420ms ease both;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

p,
h1,
h2,
h3,
h4 {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 3px solid rgba(101, 118, 222, 0.45);
  outline-offset: 3px;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
}

.container {
  width: min(calc(100% - 48px), var(--content-width));
  margin-inline: auto;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

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

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

.button-primary:hover {
  background: var(--blue-deep);
}

.button-secondary {
  border-color: var(--line-strong);
  background: rgba(255, 253, 251, 0.72);
}

.button-secondary:hover {
  border-color: var(--blue);
  color: var(--blue-deep);
}

.button-danger {
  border-color: rgba(182, 70, 85, 0.28);
  color: var(--danger);
}

.button-quiet {
  min-height: 38px;
  padding-inline: 13px;
  border-radius: 9px;
  color: var(--ink-soft);
}

.button-quiet:hover {
  background: var(--paper-muted);
  color: var(--ink);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 650;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.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;
}

.state-panel {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 36px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  text-align: center;
}

.state-panel[data-tone="error"] {
  border-color: rgba(182, 70, 85, 0.3);
  color: var(--danger);
}

.loading-mark {
  width: 24px;
  height: 24px;
  margin-inline: auto;
  animation: spin 900ms linear infinite;
}

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

dialog {
  color: var(--ink);
}

dialog[open] {
  animation: dialog-in 260ms cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

@keyframes app-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

  body,
  dialog[open],
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

@media (max-width: 700px) {
  .container {
    width: min(calc(100% - 32px), var(--content-width));
  }
}
