:root {
  color-scheme: light;
  --color-ink: #142033;
  --color-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-strong: #1d4ed8;
  --color-success: #0f9f6e;
  --color-warning: #c26a06;
  --color-danger: #dc2626;
  --color-line: #dce4ee;
  --color-surface: #ffffff;
  --color-surface-soft: #f6f8fb;
  --color-page: #f8fafc;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.1);
  --focus-ring: rgba(37, 99, 235, 0.24);
  --transition-fast: 140ms ease;

  --xy-font: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  --xy-ink: var(--color-ink);
  --xy-muted: var(--color-muted);
  --xy-blue: var(--color-primary);
  --xy-blue-strong: var(--color-primary-strong);
  --xy-green: var(--color-success);
  --xy-red: var(--color-danger);
  --xy-line: var(--color-line);
  --xy-surface: var(--color-surface);
  --xy-soft: var(--color-surface-soft);
  --xy-focus: var(--focus-ring);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--xy-font);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

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

button,
a,
summary {
  touch-action: manipulation;
}

img {
  max-width: 100%;
}

:where(button, input, select, textarea) {
  min-width: 0;
}

:where(button:not(:disabled), a[href], summary) {
  cursor: pointer;
}

:where(button:disabled, input:disabled, select:disabled, textarea:disabled) {
  cursor: not-allowed;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--xy-focus);
  outline-offset: 2px;
}

::selection {
  color: #fff;
  background: var(--xy-blue);
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 12px;
  padding: 9px 13px;
  border-radius: 6px;
  color: #fff;
  background: #142033;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
