/* ==========================================================================
   有道翻译 官方网站 — foundation.css
   基础重置、设计变量、排版基线与通用工具类
   ========================================================================== */

:root {
  --c-primary: #052953;
  --c-primary-light: #007cc2;
  --c-accent: #f60;
  --c-accent-dark: #e05500;
  --c-text: #1a1a1a;
  --c-text-muted: #5b6270;
  --c-text-faint: #8b93a1;
  --c-bg: #ffffff;
  --c-bg-alt: #f5f7fa;
  --c-border: #e5e7eb;
  --c-footer: #0b1a2b;
  --radius-btn: 10px;
  --radius-card: 14px;
  --radius-icon: 10px;
  --shadow-card: 0 2px 10px rgba(5, 41, 83, .06);
  --shadow-card-hover: 0 12px 30px rgba(5, 41, 83, .12);
  --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --container: 1200px;
  --header-h: 64px;
  --space-section: 56px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color .18s ease;
}
a:hover { color: var(--c-primary-light); }

h1, h2, h3, h4 {
  margin: 0;
  color: var(--c-primary);
  line-height: 1.35;
  font-weight: 700;
}
h1 { font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; font-weight: 600; color: var(--c-text); }
h4 { font-size: 1rem; font-weight: 600; color: var(--c-text); }
p { margin: 0; }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--c-primary-light);
  outline-offset: 3px;
}

table { border-collapse: collapse; width: 100%; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  background: var(--c-primary);
  color: #fff;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
  :root { --space-section: 88px; }
}

@media (min-width: 1024px) {
  h1 { font-size: clamp(2rem, 4vw, 3rem); }
  h2 { font-size: 2rem; }
  :root { --space-section: 104px; --header-h: 72px; }
}

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