@font-face {
  font-family: "Smiley Sans";
  src: url("/assets/fonts/smiley-sans/SmileySans-Oblique.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-display: "Smiley Sans", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --font-body: "Segoe UI Variable", "HarmonyOS Sans SC", "MiSans", "PingFang SC",
    "Microsoft YaHei UI", sans-serif;
  --shell-bg: #f7f8f4;
  --shell-bg-2: #dfeae7;
  --shell-ink: #19242d;
  --shell-muted: #69767d;
  --shell-violet: #7068c9;
  --shell-cyan: #59b8b2;
  --shell-pink: #dc8794;
  --shell-peach: #f19b7a;
  --shell-line: rgba(255, 255, 255, 0.78);
  --shell-line-soft: rgba(64, 88, 98, 0.16);
  --shell-glass: rgba(255, 255, 255, 0.56);
  --shell-glass-strong: rgba(255, 255, 255, 0.78);
  --shell-shadow: 0 22px 70px rgba(45, 72, 78, 0.15);
  --shell-shadow-soft: 0 12px 38px rgba(45, 72, 78, 0.1);
  --shell-radius: 26px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --shell-bg: #0c131b;
  --shell-bg-2: #182831;
  --shell-ink: #f4f3ed;
  --shell-muted: #b4bec0;
  --shell-line: rgba(255, 255, 255, 0.19);
  --shell-line-soft: rgba(214, 233, 228, 0.12);
  --shell-glass: rgba(18, 32, 39, 0.58);
  --shell-glass-strong: rgba(22, 39, 47, 0.82);
  --shell-shadow: 0 26px 78px rgba(0, 0, 0, 0.42);
  --shell-shadow-soft: 0 14px 42px rgba(0, 0, 0, 0.28);
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body.liquid-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(89, 184, 178, 0.2), transparent 28rem),
    radial-gradient(circle at 86% 10%, rgba(241, 155, 122, 0.18), transparent 30rem),
    radial-gradient(circle at 68% 82%, rgba(112, 104, 201, 0.11), transparent 28rem),
    linear-gradient(145deg, var(--shell-bg), var(--shell-bg-2));
  color: var(--shell-ink);
  font-family: var(--font-body);
  transition: background-color 0.35s ease, color 0.35s ease;
}

body.liquid-page::before,
body.liquid-page::after {
  content: "";
  position: fixed;
  z-index: -2;
  width: min(58vw, 780px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(18px);
  pointer-events: none;
}

body.liquid-page::before {
  top: -28vw;
  left: -22vw;
  background: radial-gradient(circle, rgba(89, 184, 178, 0.28), transparent 68%);
}

body.liquid-page::after {
  right: -24vw;
  bottom: -32vw;
  background: radial-gradient(circle, rgba(241, 155, 122, 0.24), transparent 68%);
}

.liquid-page *,
.liquid-page *::before,
.liquid-page *::after {
  box-sizing: border-box;
}

.liquid-page a {
  color: inherit;
}

.liquid-page button,
.liquid-page input,
.liquid-page textarea,
.liquid-page select {
  font: inherit;
}

.liquid-page :focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--shell-bg), 0 0 0 6px var(--shell-violet);
}

.wb-nav {
  position: fixed;
  z-index: 900;
  border: 1px solid var(--shell-line);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.3), transparent 36%),
    var(--shell-glass);
  box-shadow: var(--shell-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  backdrop-filter: blur(26px) saturate(155%);
}

.wb-nav--top {
  top: 12px;
  left: 50%;
  width: min(760px, calc(100% - 28px));
  min-height: 58px;
  border-radius: 999px;
  transform: translateX(-50%);
}

.wb-nav--bottom {
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  left: 12px;
  min-height: 66px;
  border-radius: 24px;
}

.wb-nav-inner {
  min-height: inherit;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 3px;
  padding: 5px;
}

.wb-nav--top .wb-nav-inner {
  grid-template-columns: repeat(5, 1fr) auto;
}

.wb-nav--bottom .wb-nav-inner {
  grid-template-columns: repeat(5, 1fr);
}

.wb-nav a {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--shell-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.wb-nav a:hover {
  color: var(--shell-ink);
  transform: translateY(-1px);
}

.wb-nav a.active {
  background: rgba(89, 184, 178, 0.16);
  color: var(--shell-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.wb-nav .nav-icon {
  font-size: 17px;
  line-height: 1;
}

.wb-nav .nav-label {
  font-size: 12px;
  font-weight: 650;
}

.wb-nav-theme {
  min-width: 36px;
  min-height: 36px;
  margin-left: 3px;
  border: 0;
  border-radius: 50%;
  background: rgba(112, 104, 201, 0.12);
  color: var(--shell-ink);
  cursor: pointer;
}

.liquid-panel {
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 46%),
    var(--shell-glass);
  box-shadow: var(--shell-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

/* Content pages */
.page-article {
  display: block !important;
  padding: 110px 16px 96px !important;
}

.page-article .article {
  max-width: 780px;
  margin: 0 auto;
}

.page-article .back {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  margin-bottom: 32px;
  padding: 0 16px;
  border: 1px solid var(--shell-line);
  border-radius: 999px;
  background: var(--shell-glass);
  color: var(--shell-muted);
  text-decoration: none;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.page-article h1 {
  margin: 0 0 14px;
  color: var(--shell-ink);
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

.page-article .meta {
  margin-bottom: 30px;
  color: var(--shell-muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.page-article .content {
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--shell-glass);
  color: var(--shell-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 2;
  box-shadow: var(--shell-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  backdrop-filter: blur(26px) saturate(140%);
}

.page-about {
  display: block !important;
  padding: 100px 16px 72px !important;
}

.page-about .container {
  width: min(100%, 900px);
  margin: 0 auto;
}

.page-about .top-bar {
  display: none;
}

.page-about .hero {
  padding: 48px 0 42px;
}

.page-about .hero h1 {
  color: var(--shell-ink);
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 76px);
  letter-spacing: -0.02em;
  text-shadow: none;
}

.page-about .hero .tagline,
.page-about .card p,
.page-about tbody td,
.page-about .footer {
  color: var(--shell-muted);
}

.page-about .card {
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 46%),
    var(--shell-glass);
  box-shadow: var(--shell-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

.page-about .card h2 {
  color: var(--shell-ink);
  font-size: 21px;
}

.page-about .card h3,
.page-about thead th,
.page-about .status-ok {
  color: var(--shell-violet);
}

.page-about .card a {
  color: #3f79c8;
}

html[data-theme="dark"] .page-about .card a {
  color: var(--shell-cyan);
}

.page-about .page-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-color: var(--shell-line-soft);
  border-radius: 999px;
  background: rgba(89, 184, 178, 0.11);
  color: var(--shell-ink) !important;
}

.page-about table {
  display: block;
  overflow-x: auto;
  color: var(--shell-ink);
}

.page-about tbody td,
.page-about thead th {
  border-color: var(--shell-line-soft);
}

/* 404 */
.page-404 {
  display: grid !important;
  place-items: center;
  padding: 96px 18px 88px;
}

.page-404 .box {
  position: relative;
  width: min(620px, 100%);
  max-width: none;
  overflow: hidden;
  padding: clamp(48px, 9vw, 84px) 28px;
  border: 1px solid var(--shell-line);
  border-radius: 42px;
  background: var(--shell-glass);
  box-shadow: var(--shell-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(30px) saturate(155%);
  backdrop-filter: blur(30px) saturate(155%);
}

.page-404 .box::before {
  content: "";
  position: absolute;
  inset: -45% 12% 38%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 47% 53% 43% 57% / 51% 44% 56% 49%;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.88), transparent 24%),
    linear-gradient(135deg, rgba(89, 184, 178, 0.58), rgba(241, 155, 122, 0.4), rgba(112, 104, 201, 0.32));
  box-shadow: inset 0 -20px 54px rgba(112, 104, 201, 0.16);
  opacity: 0.82;
}

.page-404 .code,
.page-404 .title,
.page-404 .msg,
.page-404 .btn {
  position: relative;
}

.page-404 .code {
  color: var(--shell-ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(88px, 20vw, 150px);
  font-weight: 300;
  letter-spacing: -0.08em;
}

.page-404 .title {
  color: var(--shell-ink);
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 40px);
}

.page-404 .msg {
  color: var(--shell-muted);
}

.page-404 .btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 22px;
  border-color: rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: linear-gradient(125deg, var(--shell-violet), #7775c8 52%, #438f91);
  color: #fff;
  box-shadow: 0 12px 28px rgba(86, 101, 232, 0.28);
}

/* Admin */
.page-admin {
  padding: 40px 16px 80px !important;
}

.page-admin .shell {
  width: min(1040px, 100%);
}

.page-admin .login {
  width: min(460px, 100%);
  margin: 12vh auto 0;
}

.page-admin .panel,
.page-admin .item {
  border: 1px solid var(--shell-line);
  border-radius: var(--shell-radius);
  background: var(--shell-glass);
  box-shadow: var(--shell-shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
  backdrop-filter: blur(24px) saturate(145%);
}

.page-admin .panel {
  padding: clamp(22px, 4vw, 34px);
}

.page-admin h1,
.page-admin h2,
.page-admin h3 {
  color: var(--shell-ink);
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.page-admin .muted,
.page-admin label,
.page-admin .meta {
  color: var(--shell-muted);
}

.page-admin input {
  border-color: var(--shell-line-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
  color: var(--shell-ink);
}

html[data-theme="dark"] .page-admin input {
  background: rgba(3, 8, 18, 0.3);
}

.page-admin button,
.page-admin .topbar a {
  min-height: 42px;
  border-radius: 999px;
}

.page-admin button:not(.danger) {
  border: 0;
  padding: 0 18px;
  background: linear-gradient(125deg, var(--shell-violet), #7775c8 52%, #438f91);
  color: #fff;
}

.page-admin .topbar a {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--shell-line-soft);
  background: var(--shell-glass);
}

@media (max-width: 860px) {
  .wb-nav--top {
    display: none !important;
  }

  .wb-nav--bottom {
    display: block !important;
  }

  .wb-nav a {
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 5px 2px;
    border-radius: 18px;
  }

  .wb-nav .nav-icon {
    font-size: 18px;
  }

  .wb-nav .nav-label {
    font-size: 10px;
  }

  .liquid-page:not(.page-admin) {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0)) !important;
  }
}

@media (min-width: 861px) {
  .wb-nav--top {
    display: block !important;
  }

  .wb-nav--bottom {
    display: none !important;
  }
}

@media (max-width: 620px) {
  .page-article {
    padding: 70px 12px 90px !important;
  }

  .page-article h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .page-article .content {
    padding: 24px 20px;
    font-size: 16px;
  }

  .page-about {
    padding: 54px 10px 92px !important;
  }

  .page-about .hero {
    padding-top: 30px;
  }

  .page-about .card {
    padding: 20px 16px;
  }

  .page-404 {
    padding-inline: 12px;
  }

  .page-admin {
    padding-inline: 10px !important;
  }
}

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

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