:root {
  color-scheme: light;
  --bg: #eef2f8;
  --ink: #111827;
  --muted: #6b7280;
  --line: rgba(17, 24, 39, 0.1);
  --panel: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 70px rgba(20, 31, 58, 0.18);
  --header-h: 58px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
}

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

.scroll-progress {
  display: none;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #00c2ff, #2f6dff);
  transform-origin: left center;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(0, 800px) minmax(72px, 1fr);
  align-items: center;
  gap: 12px;
  height: var(--header-h);
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 30px rgba(20, 31, 58, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  display: inline-flex;
  align-items: center;
  height: 34px;
}

.page-nav {
  display: flex;
  justify-self: center;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  scroll-padding-inline: 50%;
}

.site-header::after {
  content: "";
  justify-self: end;
  width: 72px;
  height: 1px;
}

.page-nav::-webkit-scrollbar {
  display: none;
}

.page-nav a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.page-nav a:hover,
.page-nav a.is-active {
  border-color: rgba(47, 109, 255, 0.22);
  color: #0f4ee8;
  background: rgba(47, 109, 255, 0.1);
}

.portfolio {
  width: 100%;
  margin: 0;
  padding: 0;
}

.sheet {
  scroll-margin-top: 0;
  margin: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.sheet img {
  width: 100%;
  background: #fff;
}

.back-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  color: #fff;
  background: rgba(16, 19, 31, 0.72);
  box-shadow: 0 14px 34px rgba(20, 31, 58, 0.24);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-top:hover {
  background: rgba(16, 19, 31, 0.9);
}

@media (min-width: 1600px) {
  .portfolio {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  :root {
    --header-h: 54px;
  }

  .portfolio {
    padding-right: 0;
    padding-left: 0;
  }

  .sheet {
    margin-bottom: 0;
    box-shadow: none;
  }

  .page-nav {
    justify-content: flex-start;
    padding: 8px 50%;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 50px;
  }

  body {
    background: #f4f6fa;
  }

  .site-header {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    gap: 8px;
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .brand {
    font-size: 14px;
  }

  .brand span {
    height: 30px;
  }

  .page-nav a {
    min-width: 34px;
    height: 28px;
    padding: 0 9px;
    font-size: 12px;
  }

  .portfolio {
    width: 100%;
    padding: 0;
  }

  .sheet {
    width: 100%;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .back-top {
    width: 40px;
    height: 40px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
