:root {
  color-scheme: light;
  --ocean: #103a5c;
  --accent: #0a7ea4;
  --background: #eef2f6;
  --paper: #ffffff;
  --secondary: #f7f9fb;
  --border: #d8dee6;
  --text: #1f2d3d;
  --muted: #546477;
  --selection: #e6eef5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--background);
}

body {
  margin: 0;
  color: var(--text);
  font: 17px/1.85 "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC",
    system-ui, sans-serif;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--ocean);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 10px 16px;
  background: var(--paper);
  transform: translateY(-160%);
}

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

.site-header {
  width: min(100% - 48px, calc(75ch + 96px));
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.site-header a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.site-header a:hover {
  text-decoration: underline;
}

main {
  width: min(100% - 48px, calc(75ch + 96px));
  margin: 40px auto;
  padding: 44px 48px;
  background: var(--paper);
  border: 1px solid var(--border);
}

h1,
h2,
h3 {
  color: var(--ocean);
  line-height: 1.4;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 4.2vw, 2.35rem);
  font-weight: 700;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 700;
}

h3 {
  margin: 28px 0 10px;
  font-size: 1.05rem;
  font-weight: 650;
}

p {
  margin: 0 0 18px;
  overflow-wrap: anywhere;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.metadata div {
  display: flex;
  gap: 8px;
}

dt,
dd {
  margin: 0;
}

.lead {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.85;
}

nav {
  margin: 30px 0 36px;
  padding: 18px 0;
  border-block: 1px solid var(--border);
}

nav p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  display: inline-block;
  min-height: 44px;
  padding: 8px 2px;
  font-size: 0.95rem;
}

section {
  margin-top: 42px;
  scroll-margin-top: 24px;
}

section:target > h2 {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.25em;
}

ul {
  margin: 0 0 20px;
  padding-left: 1.35em;
}

li {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  margin: 18px 0 24px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.95rem;
  line-height: 1.75;
}

caption {
  margin-bottom: 12px;
  color: var(--muted);
  text-align: left;
  font-size: 0.9rem;
}

th,
td {
  padding: 14px 16px;
  border: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

th {
  color: var(--ocean);
  background: var(--secondary);
  font-weight: 650;
}

th:first-child {
  width: 28%;
}

code {
  font: 0.9em/1.6 Consolas, "SFMono-Regular", monospace;
  overflow-wrap: anywhere;
}

.contact {
  font-size: 1.1rem;
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  main {
    width: calc(100% - 24px);
    margin: 12px auto;
    padding: 26px 20px;
  }

  .site-header {
    width: calc(100% - 24px);
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 0 16px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  nav {
    margin-block: 24px;
  }

  nav ul {
    gap: 2px 10px;
  }

  section {
    margin-top: 34px;
  }

  th,
  td {
    padding: 12px 10px;
  }

  th:first-child {
    width: 31%;
  }
}

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

@media print {
  html,
  body {
    background: white;
  }

  body {
    font-size: 11pt;
  }

  main {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
  }

  nav,
  .skip-link,
  .site-header {
    display: none;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  tr {
    break-inside: avoid;
  }
}
