:root {
  color-scheme: light;
  --bg: #FAFBFB;
  --panel: #FFFFFF;
  --panel-2: #F1F3F6;
  --panel-3: #F7F8FA;
  --border: #E3E6EC;
  --border-soft: #ECEEF2;
  --accent: #2C62F5;
  --accent-dark: #1D45C2;
  --accent-2: #5B8CFF;
  --text: #1C1F26;
  --muted: #5E6573;
  --faint: #8C93A0;
  --success: #1F9D61;
  --success-ink: #167747;
  --warn: #D98A0B;
  --error: #D6453D;
  --graphite: #1B1D22;
  --graphite-2: #2A2D35;
  --charcoal: #24272E;
  --mist: #E8EDF6;
  --on-dark: #FFFFFF;
  --dot-red: #F2655B;
  --dot-amber: #F3BD4E;
  --dot-green: #5CC168;
  --flag-red: #D9312B;
  --flag-white: #FFFFFF;
  --flag-blue: #2D3B8E;
  --flag-green: #1F8A4C;
  --flag-it-red: #C8343F;
  --flag-jp: #C7243A;
  --problem-red: #F9DDDA;
  --problem-blue: #DDEBFF;
  --problem-violet: #EAE1F5;
  --problem-yellow: #FAEDC8;
  --rope-edge: #CBD0D8;
  --accent-rgb: 44,98,245;
  --accent2-rgb: 91,140,255;
  --sky-rgb: 150,198,255;
  --ink-rgb: 28,31,38;
  --white-rgb: 255,255,255;
  --success-rgb: 31,157,97;
  --font-display: "Source Han Serif SC","Noto Serif SC","Songti SC","STSong",Georgia,"Times New Roman",serif;
  --font-body: "Inter","Noto Sans SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  --font-mono: "JetBrains Mono",ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  --h1: clamp(52px,5vw,72px);
  --hero-size: 64px;
  --h2: clamp(28px,4vw,44px);
  --h3: clamp(20px,2vw,24px);
  --r-flag: 3px;
  --r-micro: 4px;
  --r-count: 5px;
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-frame: 18px;
  --r-pill: 999px;
  --wrap: 1200px;
  --gutter: 24px;
  --unit: 8px;
  --section-space: 80px;
  --header-height: 64px;
  --toc-space: 60px;
  --shadow-panel: inset 0 1px 0 rgba(var(--white-rgb),1),0 22px 54px -24px rgba(var(--accent-rgb),.12);
}
*,*::before,*::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 12px);
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
p,figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
:where(a,button,summary,input,select,textarea,[tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1,h2,h3 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1 { font-size: var(--h1); }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); }
code,kbd,pre { font-family: var(--font-mono); }
code { overflow-wrap: anywhere; }
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--panel-2);
}
pre code { overflow-wrap: normal; white-space: pre; }
.sprite,.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.no-break { white-space: nowrap; }
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.reading-wrap { max-width: 840px; }
.section-space { padding-top: var(--section-space); padding-bottom: var(--section-space); }
.page-intro { padding-top: 56px; padding-bottom: 32px; }
.page-intro p { max-width: 72ch; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 16px; }
.grid > *, .wrap > *, .masthead-in > * { min-width: 0; }
.panel,.card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}
.card { padding: 24px; }
.card p { color: var(--muted); }
.stripe,.top { position: relative; isolation: isolate; overflow-x: clip; max-width: 100%; }
.stripe-halo { position: absolute; inset: 0 0 auto auto; width: 45%; max-width: 100%; aspect-ratio: 1; pointer-events: none; z-index: -1; background: radial-gradient(closest-side,rgba(var(--sky-rgb),.42),rgba(var(--sky-rgb),0)); }
#server-status { position: static; min-width: 0; max-width: 100%; overflow: hidden; margin-block-end: 24px; }
#server-status > * { min-width: 0; max-width: 100%; }
.reveal { transition: opacity .36s ease, transform .36s ease; }
.reveal.pending { opacity: 0; transform: translateY(16px); }
.reveal.shown { opacity: 1; transform: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: center;
  transition: transform .2s,box-shadow .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--on-dark); box-shadow: inset 0 1px 0 rgba(var(--white-rgb),.22),0 10px 26px rgba(var(--accent-rgb),.24); }
.btn-primary:not(:disabled):hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost,.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(var(--white-rgb),.9); }
.btn-ghost:not(:disabled):hover,.btn-secondary:not(:disabled):hover { border-color: rgba(var(--ink-rgb),.18); }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn:disabled { color: var(--muted); background: var(--panel-2); box-shadow: none; cursor: not-allowed; }
.btn-secondary { flex-shrink: 0; white-space: nowrap; }

#site-header { position: sticky; top: 0; z-index: 35; }
.masthead {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgba(var(--ink-rgb),.06);
  background: rgba(var(--white-rgb),.55);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
}
.masthead-in { display: flex; align-items: center; height: var(--header-height); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; min-height: 30px; }
.logo-mark { display: block; width: 30px; height: 30px; flex-shrink: 0; }
.brand-word { font-weight: 700; font-size: 18px; letter-spacing: .01em; white-space: nowrap; }
.tabs { display: flex; flex: 1; min-width: 0; height: 100%; margin-left: 44px; }
.tabs ul { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; gap: 2px; min-width: 0; }
.tabs li { display: flex; align-items: stretch; min-width: 0; height: 100%; }
.tab { position: relative; display: inline-flex; align-items: center; padding-inline: 12px; font-size: 14.5px; color: var(--muted); line-height: 1.25; overflow-wrap: normal; text-wrap: balance; }
.tab:hover,.tab.is-active { color: var(--text); }
.tab.is-active { font-weight: 600; }
.tab.is-active::after { content: ""; position: absolute; inset: auto 12px -1px; height: 2px; border-radius: var(--r-pill); background: var(--accent); }
.masthead-end { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-shrink: 0; }
.lang-picker { position: relative; }
.lang,.login { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; border-radius: var(--r-sm); font-size: 14px; white-space: nowrap; }
.lang { gap: 6px; padding: 0 10px; color: var(--muted); width: auto; }
.lang span { white-space: nowrap; }
.lang:hover { background: rgba(var(--ink-rgb),.04); color: var(--text); }
.lang svg { width: 16px; height: 16px; }
.lang-menu { position: absolute; z-index: 8; inset: calc(100% + 8px) 0 auto auto; min-width: 144px; padding: 6px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel); box-shadow: var(--shadow-panel); }
.lang-menu a { display: flex; align-items: center; min-height: 36px; padding: 4px 10px; border-radius: var(--r-xs); white-space: nowrap; }
.lang-menu a:hover,.lang-menu a[aria-current],.drawer a[aria-current] { background: rgba(var(--accent-rgb),.10); color: var(--accent-dark); }
.login { padding: 0 18px; font-weight: 600; color: var(--accent-dark); background: var(--panel); border: 1px solid rgba(var(--accent-rgb),.32); box-shadow: 0 4px 14px rgba(var(--accent-rgb),.08); }
.login:hover { border-color: rgba(var(--accent-rgb),.55); }
.menu-toggle { display: none; min-width: 44px; min-height: 44px; border-radius: var(--r-sm); place-content: center; gap: 4px; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: var(--r-pill); }
.menu-toggle[aria-expanded="true"] { color: var(--accent-dark); background: var(--panel-2); }
.drawer,.drawer-veil { position: fixed; top: calc(var(--header-height) + 1px); }
.drawer-veil { z-index: 1; inset-inline: 0; bottom: 0; background: rgba(var(--ink-rgb),.32); }
.drawer {
  z-index: 2;
  right: 0;
  width: min(100%,360px);
  height: calc(100dvh - var(--header-height) - 1px);
  max-height: calc(100dvh - var(--header-height) - 1px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px var(--gutter) calc(24px + env(safe-area-inset-bottom,0px));
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
}
.drawer a { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm); }
.drawer a:hover { background: var(--panel-2); }
.drawer-languages { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
html.nav-open { overflow: hidden; }

.site-end { background: var(--panel-2); border-top: 1px solid var(--border); }
.end-grid {
  display: grid;
  grid-template-columns: minmax(0,1.6fr) minmax(0,1.4fr) minmax(0,1fr) minmax(0,.7fr);
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 32px;
}
.end-grid > * { min-width: 0; }
.end-brand p { max-width: 37ch; margin-top: 12px; color: var(--muted); font-size: 14px; }
.end-label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.end-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.end-langs { flex-direction: column; align-items: flex-start; }
.end-links a,.end-legal a { display: inline-flex; align-items: center; min-height: 28px; color: var(--muted); font-size: 14px; }
.end-links a:hover,.end-legal a:hover { color: var(--accent-dark); text-decoration: underline; }
.end-links a[aria-current] { color: var(--accent-dark); font-weight: 600; }
.end-legal { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; border-top: 1px solid var(--border); padding-block: 16px; color: var(--muted); font-size: 13px; }
.end-legal div { display: flex; flex-wrap: wrap; gap: 16px; }
@media (max-width: 1248px) {
  .tabs { margin-left: 24px; }
  .tab { padding-inline: 9px; font-size: 14px; }
  .tab.is-active::after { left: 9px; right: 9px; }
}
@media (max-width: 1023px) {
  .masthead-in { flex-wrap: nowrap; }
  #site-header .tabs { display: none; }
  .menu-toggle { display: inline-grid; }
  .masthead-end { margin-left: auto; }
  .end-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 768px) {
  :root { --h1: clamp(28px,8vw,40px); --hero-size: clamp(28px,8vw,40px); --section-space: 56px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --header-height: 60px; }
  .no-break { white-space: normal; }
  .tilt,.decor-tilt { transform: none; }
  .stripe-halo,.top::after { max-width: 100%; }
  .masthead-end { gap: 4px; }
  .masthead-in .brand { gap: 5px; }
  .masthead-in .brand-word { font-size: 15px; }
  .masthead-in .logo-mark { width: 24px; height: 24px; }
  .lang { gap: 4px; padding-inline: 5px; font-size: 12px; }
  .lang svg { width: 14px; height: 14px; }
  .login { padding-inline: 9px; font-size: 12px; }
  .end-grid { gap: 24px 16px; }
  .end-brand { grid-column: 1 / -1; }
  .btn { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,.reveal.pending { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}