:root {
  color-scheme: light;
  --bg: #fdfefd;
  --nav: #f7f9f7;
  --surface: #f4f7f4;
  --raised: #fff;
  --ink: #17221c;
  --body: #38473f;
  --muted: #596a60;
  --edge: #dfe7e1;
  --accent: #176248;
  --accent-bg: #e7f3eb;
  --warn: #775218;
  --warn-bg: #fff7e9;
  --warn-edge: #ecdbaf;
  --shadow: 0 20px 60px #10271828;
  --header: 66px;
  --gutter: clamp(22px, 3vw, 48px);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111815;
  --nav: #151e19;
  --surface: #1a251e;
  --raised: #17201b;
  --ink: #eff6f1;
  --body: #cbd8d0;
  --muted: #a0b2a6;
  --edge: #2e3e33;
  --accent: #8cdbb1;
  --accent-bg: #203a2c;
  --warn: #f4d68e;
  --warn-bg: #2b261b;
  --warn-edge: #554627;
  --shadow: 0 20px 60px #0007;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #111815;
    --nav: #151e19;
    --surface: #1a251e;
    --raised: #17201b;
    --ink: #eff6f1;
    --body: #cbd8d0;
    --muted: #a0b2a6;
    --edge: #2e3e33;
    --accent: #8cdbb1;
    --accent-bg: #203a2c;
    --warn: #f4d68e;
    --warn-bg: #2b261b;
    --warn-edge: #554627;
    --shadow: 0 20px 60px #0007;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header) + 27px); }
body { margin: 0; color: var(--ink); background: var(--bg); }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { flex: none; }
.skip-link { position: fixed; z-index: 10; inset: 12px auto auto 16px; transform: translateY(-150%); padding: 10px 14px; color: var(--ink); background: var(--raised); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; z-index: 5; top: 0; background: var(--bg); border-bottom: 1px solid var(--edge); }
.header-inner {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 390px) 1fr;
  align-items: center;
  gap: 24px;
  width: min(1510px, 100%);
  min-height: calc(var(--header) - 1px);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; font-size: 17px; font-weight: 650; letter-spacing: -.025em; text-decoration: none; }
.brand img { display: block; }
.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 11px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--edge);
  border-radius: 8px;
  font-size: 14px;
  text-align: left;
}
.search-trigger:hover, .icon-button:hover { color: var(--ink); background: var(--surface); border-color: var(--accent); }
.search-trigger kbd { margin-left: auto; color: var(--muted); font: inherit; font-size: 12px; border: 1px solid var(--edge); border-radius: 4px; padding: 1px 5px; }
.header-actions { display: flex; justify-content: flex-end; gap: 7px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; }
.navigation-toggle { display: none; }

.doc-grid {
  display: grid;
  grid-template-columns: clamp(195px, 17vw, 236px) minmax(0, 760px) minmax(140px, 200px);
  align-items: start;
  column-gap: clamp(27px, 4vw, 63px);
  max-width: 1510px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.sidebar, .toc { position: sticky; top: var(--header); max-height: calc(100dvh - var(--header)); overflow-y: auto; scrollbar-width: thin; }
.sidebar { min-height: calc(100dvh - var(--header)); padding: 38px 20px 32px 0; border-right: 1px solid var(--edge); }
.sidebar ul, .toc ul { margin: 0; padding: 0; list-style: none; }
.nav-group + .nav-group { margin-top: 28px; }
.nav-group h2 { margin: 0 0 8px; padding-left: 10px; font-size: 13px; font-weight: 650; }
.nav-group a { display: block; margin-block: 2px; padding: 8px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.45; }
.nav-group a:hover { background: var(--surface); color: var(--ink); }
.nav-group a[aria-current="page"] { color: var(--accent); background: var(--accent-bg); font-weight: 650; }
.toc { padding: 48px 4px 30px 0; }
.toc p { display: flex; align-items: center; gap: 8px; margin: 0 0 11px; font-size: 13px; font-weight: 650; }
.toc svg { width: 17px; height: 17px; }
.toc ul { border-left: 1px solid var(--edge); }
.toc a { display: block; margin-left: -1px; padding: 7px 0 7px 12px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.55; }
.toc a:hover, .toc a[aria-current] { color: var(--accent); border-left-color: var(--accent); }
.toc-h3 a { padding-left: 22px; }

.doc-main { min-width: 0; padding-block: 46px 70px; }
.doc-heading { margin-bottom: 28px; }
.doc-heading h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.18; letter-spacing: -.035em; font-weight: 700; }
.doc-heading p { margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.route-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 32px; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--edge); border-radius: 10px; }
.route-flow li { display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; padding: 15px 10px 15px 13px; }
.route-flow li + li { border-left: 1px solid var(--edge); }
.route-flow li + li::before { position: absolute; left: -5px; top: 50%; width: 7px; height: 7px; content: ""; transform: translateY(-50%) rotate(45deg); border-top: 1px solid var(--muted); border-right: 1px solid var(--muted); background: var(--surface); }
.flow-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; background: var(--accent-bg); color: var(--accent); border-radius: 7px; }
.flow-icon svg { width: 18px; height: 18px; }
.route-flow strong, .route-flow small { display: block; }
.route-flow strong { margin-bottom: 3px; font-size: 13px; }
.route-flow small { color: var(--muted); font-size: 12px; line-height: 1.45; }

.prose { color: var(--body); font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.prose h2, .prose h3 { color: var(--ink); line-height: 1.4; font-weight: 680; }
.prose h2 { margin: 40px 0 14px; padding-top: 23px; border-top: 1px solid var(--edge); font-size: 24px; letter-spacing: -.02em; }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin: 23px 0 9px; font-size: 18px; }
.prose p, .prose ul, .prose ol { margin-block: 10px 16px; }
.prose ul, .prose ol { padding-inline-start: 1.55em; }
.prose li + li { margin-top: 7px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }
.heading-link { margin-inline-start: .45em; font-size: .75em; text-decoration: none; opacity: 0; }
:is(h2, h3):is(:hover, :focus-within, :target) .heading-link { opacity: 1; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--edge); border-radius: 8px; font-size: 14px; line-height: 1.55; }
.prose table :is(th, td) { padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { color: var(--ink); background: var(--surface); }
.prose th:first-child { border-radius: 7px 0 0 0; }
.prose th:last-child { border-radius: 0 7px 0 0; }
.prose td { border-top: 1px solid var(--edge); }
.prose :not(pre) > code { padding: .12em .33em; border-radius: 4px; color: var(--accent); background: var(--surface); }
.prose code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .88em; }
.code-block { margin-block: 16px; border: 1px solid var(--edge); border-radius: 8px; background: var(--surface); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding-inline: 13px; border-bottom: 1px solid var(--edge); font-size: 12px; color: var(--muted); }
.copy-code { min-height: 28px; padding-inline: 7px; background: var(--raised); color: var(--ink); border: 1px solid var(--edge); border-radius: 5px; }
.copy-code:hover { color: var(--accent); border-color: var(--accent); }
.prose pre { margin: 0; padding: 13px; overflow-x: auto; line-height: 1.6; }
.prose blockquote { margin-inline: 0; padding-inline-start: 16px; border-left: 2px solid var(--edge); }
.callout { display: flex; gap: 11px; align-items: flex-start; margin-block: 18px; padding: 13px 14px; border: 1px solid var(--edge); border-radius: 8px; background: var(--accent-bg); }
.callout svg { color: var(--accent); margin-top: 3px; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout.warning { border-color: var(--warn-edge); background: var(--warn-bg); }
.callout.warning svg { color: var(--warn); }
.prose img { display: block; max-width: 100%; height: auto; border: 1px solid var(--edge); border-radius: 8px; }

.pagination { display: flex; gap: 12px; margin-top: 38px; }
.page-link { position: relative; flex: 1; min-width: 0; padding: 12px 44px 13px 15px; border: 1px solid var(--edge); border-radius: 8px; text-decoration: none; }
.page-link span, .page-link strong { display: block; }
.page-direction { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.page-link strong { font-size: 14px; }
.page-link svg { position: absolute; inset: 50% 14px auto auto; transform: translateY(-50%); color: var(--accent); }
.page-link:hover { border-color: var(--accent); background: var(--surface); }

.search-dialog { width: min(600px, calc(100% - 26px)); max-height: calc(100dvh - 40px); margin: min(12vh, 100px) auto auto; padding: 0; color: var(--ink); background: var(--raised); border: 1px solid var(--edge); border-radius: 12px; box-shadow: var(--shadow); }
.search-dialog::backdrop { background: #12221968; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 11px 13px; color: var(--muted); border-bottom: 1px solid var(--edge); }
.search-field input { flex: 1; min-width: 0; padding: 8px; border: 0; border-radius: 4px; background: var(--raised); color: var(--ink); font-size: 16px; }
.search-field input::placeholder { color: var(--muted); }
.search-status { margin: 14px 16px; color: var(--muted); font-size: 14px; }
.search-status:empty { display: none; }
.search-results { display: grid; gap: 4px; margin: 0; padding: 8px; list-style: none; }
.search-results:empty { display: none; }
.search-results a { display: block; padding: 9px 11px; border-radius: 6px; text-decoration: none; }
.search-results a:hover, .search-results a:focus-visible { background: var(--accent-bg); }
.search-results strong, .search-results small { display: block; }
.search-results small { margin-top: 3px; color: var(--muted); font-size: 13px; }

@media (max-width: 1110px) {
  .doc-grid { grid-template-columns: 194px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 720px) {
  :root { --header: 60px; }
  .header-inner { display: flex; gap: 7px; }
  .brand { margin-right: auto; gap: 8px; font-size: 15px; }
  .brand img { width: 30px; height: 30px; }
  .search-trigger { min-height: 38px; padding-inline: 8px; background: transparent; border-color: transparent; }
  .search-trigger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .search-trigger kbd { display: none; }
  .header-actions { gap: 1px; }
  .navigation-toggle { display: grid; }
  .doc-grid { display: block; }
  .sidebar { position: static; min-height: 0; max-height: none; padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--edge); }
  .js .sidebar { display: none; }
  .js .sidebar.is-open { display: block; }
  .nav-group + .nav-group { margin-top: 16px; }
  .doc-main { padding-block: 29px 46px; }
  .doc-heading p { font-size: 15px; }
  .route-flow { grid-template-columns: 1fr; }
  .route-flow li { padding: 10px 13px; gap: 12px; }
  .route-flow li + li { border-top: 1px solid var(--edge); border-left: 0; }
  .route-flow li + li::before { top: -5px; left: 27px; transform: rotate(135deg); }
  .prose table :is(th, td) { padding: 8px 7px; }
  .heading-link { opacity: 1; }
}

.prose img[src$="/add-shop-a.jpg"] {
  width: 100%;
  aspect-ratio: 1.55;
  object-fit: cover;
  object-view-box: inset(26% 21% 26% 21%);
}
