:root {
  --header-h: 64px;
  --blue: #0e4d9b;
  --blue-deep: #0a3268;
  --ink: #1b2430;
  --muted: #5b6b7c;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #d9e3ef;
  --soft: #e8f0fb;
  --warn: #8a4b12;
  --warn-bg: #fff6e8;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-deep); }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  padding: 6px 10px;
  z-index: 80;
}
.skip:focus { top: 8px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--soft);
  color: var(--blue-deep);
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 0;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-btn:hover,
.menu-btn[aria-expanded="true"] { background: var(--soft); }
.menu-btn .bars,
.menu-btn .bars::before,
.menu-btn .bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  position: relative;
}
.menu-btn .bars::before,
.menu-btn .bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-btn .bars::before { top: -6px; }
.menu-btn .bars::after { top: 6px; }
.site-header.is-open .menu-btn .bars { background: transparent; }
.site-header.is-open .menu-btn .bars::before { top: 0; transform: rotate(45deg); }
.site-header.is-open .menu-btn .bars::after { top: 0; transform: rotate(-45deg); }

.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;
}

.ad-slot { display: none; }
.ad-slot.is-on {
  display: block;
  position: sticky;
  top: var(--header-h);
  z-index: 35;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(16, 42, 77, 0.05);
}

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.page {
  padding: 28px 0 64px;
}

.crumb {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.crumb a { color: var(--muted); }

h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 18px;
  font-size: 18px;
  color: #243246;
}

.note {
  background: var(--warn-bg);
  border: 1px solid #f0ddc0;
  color: #5c3b12;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 22px;
  font-size: 15px;
}

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px 8px;
  margin: 0 0 28px;
}
.toc strong { display: block; margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin: 4px 0; }

.article h2 {
  margin: 36px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--blue);
  font-size: 26px;
  line-height: 1.4;
}

.article h3 {
  margin: 22px 0 8px;
  font-size: 20px;
}

.article p { margin: 0 0 14px; }

.article ul,
.article ol { margin: 0 0 16px; padding-left: 1.3em; }
.article li { margin: 6px 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0 8px;
}

.shot {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.shot img {
  display: block;
  width: 100%;
  background: #121826;
}
.shot figcaption {
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 15px;
}
th { background: #f7faff; color: var(--blue-deep); }
tr:last-child td { border-bottom: 0; }

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 0 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
}
.faq p { margin: 8px 0 4px; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
}
.links a {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
}

.error-code {
  font-size: 64px;
  line-height: 1;
  margin: 0 0 8px;
  color: var(--blue);
  letter-spacing: -0.04em;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.site-footer a { color: var(--muted); }

@media (max-width: 760px) {
  :root { --header-h: 58px; }
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  .article h2 { font-size: 22px; }
  .lead { font-size: 16px; }
  .gallery { grid-template-columns: 1fr; }
  .site-header {
    flex-wrap: wrap;
    align-content: flex-start;
    height: auto;
    min-height: var(--header-h);
    padding: 0 12px;
    gap: 0;
  }
  .brand { height: var(--header-h); }
  .brand span { font-size: 15px; }
  .menu-btn { display: inline-flex; }
  .nav {
    display: none;
    flex: 1 0 100%;
    flex-direction: column;
    gap: 4px;
    margin: 0 -12px;
    padding: 6px 12px 12px;
    background: #fff;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .site-header.is-open .nav { display: flex; }
  .nav a {
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 10px;
  }
  .page { padding-top: 18px; }
  .wrap { width: min(1080px, calc(100% - 20px)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
