:root {
  color-scheme: light;
  --bg: #eef4fb;
  --bg-alt: #f8fbff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --text: #122033;
  --muted: #5f6c82;
  --accent: #1a73e8;
  --accent-strong: #1558b0;
  --accent-soft: rgba(26, 115, 232, 0.1);
  --border: #d8e2ef;
  --shadow: 0 18px 40px rgba(18, 38, 63, 0.08);
  --shadow-strong: 0 24px 60px rgba(18, 38, 63, 0.12);
  --up: #c93d3d;
  --down: #0f7a54;
  --same: #64748b;
  --new: #0f62fe;
}

html {
  background: var(--bg);
  touch-action: pan-x pan-y;
}

body {
  touch-action: pan-x pan-y;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(26, 115, 232, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(15, 98, 254, 0.08), transparent 18%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 46%, #e7eff8 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 70%);
  opacity: 0.35;
  z-index: 0;
}

.page,
.card {
  position: relative;
  z-index: 1;
}

.page {
  width: min(1560px, calc(100vw - 24px));
  margin: 18px auto 32px;
}

.site-footer {
  width: min(1560px, calc(100vw - 24px));
  margin: 0 auto 28px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.site-footer-inner {
  padding: 14px 18px 0;
  border-top: 1px solid rgba(95, 108, 130, 0.18);
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 8px;
}

@media (min-width: 1041px) {
  body.has-site-nav .site-footer {
    width: min(var(--site-page-max-width), var(--site-page-available-width));
    margin:
      0
      var(--site-layout-outer-gutter)
      28px
      calc(var(--site-layout-left) + var(--site-sidebar-width) + var(--site-layout-gap));
    padding: 0;
  }

  body.has-site-nav .site-footer-inner {
    padding-left: 18px;
    padding-right: 18px;
  }
}

.hero,
.panel,
.topic-card,
.post,
.pager,
.popup,
.copy-choice-dialog,
.card,
.table-card,
.section-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero,
.panel,
.topic-card,
.post,
.pager {
  overflow: hidden;
}

.hero {
  position: relative;
  padding: 20px 22px;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #6ea8ff 48%, #64d2c7);
  opacity: 0.95;
}

.topbar,
.hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hero-head {
  margin-bottom: 16px;
}

.hero-title,
h1,
h2,
.panel-head {
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-title,
h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.hero-meta,
.meta,
.user,
.hero-user,
.topic-submeta,
.topic-helper,
.pager-info,
.popup-subtitle,
.popup-pagination,
.hint,
.details,
.notice,
.muted {
  color: var(--muted);
}

.hero-meta,
.meta,
.user,
.hero-user {
  font-size: 14px;
  line-height: 1.75;
}

.hero-user,
.user,
.actions,
.topic-action-buttons,
.pager-actions,
.popup-actions,
.copy-choice-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-user,
.user,
.actions,
.pager-actions,
.popup-actions,
.copy-choice-actions,
.row-actions {
  justify-content: flex-end;
}

.badge,
.kind,
.trend,
.tab-link,
.link-btn,
.logout-btn,
.popup-btn,
.pager-btn,
.copy-choice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(18, 38, 63, 0.04);
}

.badge {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 115, 232, 0.14), rgba(26, 115, 232, 0.08));
  border-color: rgba(26, 115, 232, 0.18);
  color: var(--accent-strong);
}

.kind,
.trend {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.trend.up {
  color: var(--up);
  background: rgba(201, 61, 61, 0.1);
}

.trend.down {
  color: var(--down);
  background: rgba(15, 122, 84, 0.1);
}

.trend.same {
  color: var(--same);
  background: rgba(100, 116, 139, 0.1);
}

.trend.new {
  color: var(--new);
  background: rgba(15, 98, 254, 0.1);
}

.link-btn:hover,
.logout-btn:hover,
.popup-btn:hover,
.pager-btn:hover,
.copy-choice-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(18, 38, 63, 0.08);
}

.link-btn.active {
  color: #fff;
  border-color: rgba(26, 115, 232, 0.08);
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.logout-btn,
.save-btn,
.danger-btn {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.danger-btn {
  background: linear-gradient(180deg, #d14343, #b42318);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  -webkit-overflow-scrolling: touch;
}

.tab-link {
  white-space: nowrap;
  min-width: 90px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}

.tab-link.active {
  color: var(--accent);
  background: #fff;
  border-color: rgba(26, 115, 232, 0.14);
  box-shadow: 0 10px 24px rgba(18, 38, 63, 0.08);
}

.panel {
  margin-top: 18px;
}

.panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
  font-size: 18px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

tbody tr:hover {
  background: rgba(26, 115, 232, 0.035);
}

.empty,
.notice,
.pager {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.7;
}

.notice.success {
  border-color: rgba(15, 122, 84, 0.18);
  background: rgba(15, 122, 84, 0.08);
  color: var(--down);
}

.notice.error {
  border-color: rgba(201, 61, 61, 0.18);
  background: rgba(201, 61, 61, 0.08);
  color: var(--up);
}

.pager {
  justify-content: space-between;
  align-items: center;
}

.pager-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(18, 38, 63, 0.04);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(26, 115, 232, 0.18);
  outline-offset: 1px;
  border-color: rgba(26, 115, 232, 0.35);
}

.card {
  position: relative;
  width: min(94vw, 460px);
  padding: 28px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #6ea8ff 48%, #64d2c7);
}

.card h1 {
  font-size: 28px;
}

.card p,
.card .links,
.card .error {
  color: var(--muted);
}

.card button {
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.2);
}

.card a {
  color: var(--accent);
}

.popup,
.copy-choice-dialog {
  box-shadow: var(--shadow-strong);
}

.popup-head,
.popup-footer,
.copy-choice-dialog,
.image-modal-dialog {
  background: rgba(255, 255, 255, 0.96);
}

.popup-head {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
}

.popup-close,
.image-modal-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.copy-choice-dialog {
  width: min(420px, calc(100vw - 24px));
  padding: 22px;
}

.copy-toast {
  background: rgba(18, 32, 51, 0.9);
}

@media (max-width: 900px) {
  .page {
    width: calc(100vw - 14px);
    margin: 10px auto 24px;
  }

  .hero,
  .panel,
  .topic-card,
  .post,
  .pager,
  .card {
    border-radius: 18px;
  }

  .hero,
  .card {
    padding: 16px;
  }

  .hero-head,
  .topbar {
    flex-direction: column;
  }

  .hero-user,
  .user,
  .actions {
    justify-content: flex-start;
  }

  .hero-title,
  h1 {
    font-size: 24px;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .tabs {
    padding: 7px;
  }

  .tab-link {
    min-width: auto;
    padding: 9px 12px;
  }
}

body.has-site-nav {
  min-height: 100vh;
}

.site-sidebar,
.site-mobile-topbar,
.site-mobile-drawer {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
}

.site-sidebar {
  position: fixed;
  z-index: 30;
  top: 18px;
  left: 18px;
  bottom: 18px;
  width: 238px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(216, 226, 239, 0.92);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.9)),
    radial-gradient(circle at top left, rgba(26, 115, 232, 0.18), transparent 36%);
  box-shadow: 0 24px 70px rgba(18, 38, 63, 0.14);
  backdrop-filter: blur(18px);
  min-height: 0;
  overflow: hidden;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.site-brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #64d2c7);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(26, 115, 232, 0.2);
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.site-brand-text strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.site-brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.site-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(216, 226, 239, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.site-user-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.site-user-card-link,
.site-user-card-link:visited,
.site-user-card-link:hover,
.site-user-card-link:active,
.site-user-card-link * {
  text-decoration: none;
}

.site-user-card-link:hover {
  border-color: rgba(26, 115, 232, 0.28);
  box-shadow: 0 12px 26px rgba(26, 115, 232, 0.1);
  transform: translateY(-1px);
}

.site-user-card.compact {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

button.site-user-card.compact {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.site-user-toggle {
  border-radius: 14px;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.site-user-toggle:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
}

.site-user-card.compact .site-user-role {
  display: none;
}

.site-user-card.compact .site-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  font-size: 13px;
}

.site-user-card.compact .site-user-name {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-user-card.compact .site-user-main {
  max-width: 90px;
  opacity: 1;
  transform: translateX(0);
  overflow: hidden;
  transition: max-width 0.22s ease, opacity 0.18s ease, transform 0.22s ease, margin 0.22s ease;
}

.site-user-card.compact.is-name-hidden {
  gap: 0;
}

.site-user-card.compact.is-name-hidden .site-user-main {
  max-width: 0;
  opacity: 0;
  transform: translateX(8px);
  margin-left: -2px;
  pointer-events: none;
}

.site-user-card.compact.is-name-hidden .site-user-avatar {
  background: linear-gradient(135deg, var(--accent-soft), rgba(100, 210, 199, 0.16));
  box-shadow: 0 10px 22px rgba(26, 115, 232, 0.12);
}

.site-user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.site-user-main {
  min-width: 0;
}

.site-user-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.site-user-name.link {
  text-decoration: none;
}

.site-user-role {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.site-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(216, 226, 239, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.site-search-form.active {
  border-color: rgba(26, 115, 232, 0.32);
  box-shadow: 0 14px 28px rgba(26, 115, 232, 0.1);
}

.site-desktop-top-search {
  display: none;
  width: min(380px, 100%);
  margin-left: auto;
  pointer-events: auto;
}

.site-desktop-top-search .site-search-form {
  pointer-events: auto;
}

.site-search-form.desktop-top {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px rgba(18, 38, 63, 0.12);
  backdrop-filter: blur(18px);
}

.site-search-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  outline: none;
  background: rgba(246, 250, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.site-search-form.desktop-top .site-search-input {
  height: 40px;
  padding: 0 4px;
  background: transparent;
  font-size: 14px;
}

.site-search-input:focus {
  box-shadow: inset 0 0 0 2px rgba(26, 115, 232, 0.18);
}

.site-search-form.desktop-top .site-search-input:focus {
  box-shadow: none;
}

.site-search-submit,
.site-mobile-search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(26, 115, 232, 0.16);
}

.site-search-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.site-search-form.desktop-top .site-search-submit {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
}

.site-search-form.desktop-top .site-search-submit-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-mobile-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.site-mobile-search-button {
  min-width: 40px;
  min-height: 38px;
  border: 1px solid rgba(26, 115, 232, 0.08);
}

.site-mobile-search-button.active {
  background: linear-gradient(135deg, #122033, var(--accent-strong));
}

.site-search-overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 78px 14px 20px;
  background: rgba(18, 32, 51, 0.36);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.site-search-overlay[hidden] {
  display: none !important;
}

.site-search-dialog {
  width: min(540px, 100%);
  padding: 16px;
  border: 1px solid rgba(216, 226, 239, 0.92);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(18, 38, 63, 0.18);
  transform: translateY(-12px);
  transition: transform 0.18s ease;
  backdrop-filter: blur(18px);
}

.site-search-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.site-search-dialog-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.site-search-dialog-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.site-search-dialog-close {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.site-search-form.modal {
  grid-template-columns: minmax(0, 1fr) 46px;
  padding: 10px;
  border-radius: 20px;
}

.site-search-form.modal .site-search-input {
  height: 44px;
  font-size: 16px;
}

.site-search-form.modal .site-search-submit {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 16px;
}

.site-search-form.modal .site-search-submit-text {
  display: none;
}

body.site-search-open {
  overflow: hidden;
}

body.site-search-open .site-search-overlay {
  display: flex;
  opacity: 1;
}

body.site-search-open .site-search-dialog {
  transform: translateY(0);
}

.site-nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 115, 232, 0.32) transparent;
}

.site-nav-list::-webkit-scrollbar {
  width: 6px;
}

.site-nav-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(26, 115, 232, 0.28);
}

.site-nav-list::-webkit-scrollbar-track {
  background: transparent;
}

.site-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.site-nav-link:hover {
  transform: translateX(2px);
  border-color: rgba(26, 115, 232, 0.18);
  background: rgba(26, 115, 232, 0.08);
}

.site-nav-link.active {
  color: #fff;
  border-color: rgba(26, 115, 232, 0.08);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 30px rgba(26, 115, 232, 0.2);
}

.site-nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(26, 115, 232, 0.1);
  color: var(--accent-strong);
  font-size: 13px;
}

.site-nav-link.active .site-nav-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.site-sidebar-footer {
  margin-top: auto;
}

.site-sidebar-footer form {
  margin: 0;
}

.site-nav-auth {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 15px;
  background: rgba(18, 32, 51, 0.08);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.site-nav-auth:hover {
  background: rgba(26, 115, 232, 0.12);
}

.site-mobile-topbar,
.site-mobile-drawer,
.site-drawer-backdrop {
  display: none;
}

body.has-site-nav .hero .actions,
body.has-site-nav .hero .hero-actions,
body.has-site-nav .hero .hero-user > form,
body.has-site-nav .hero .user > form,
body.has-site-nav .hero-head > .link-btn {
  display: none !important;
}

@media (min-width: 1041px) {
  body.has-site-nav {
    --site-sidebar-width: 238px;
    --site-layout-gap: 24px;
    --site-layout-outer-gutter: 20px;
    --site-page-max-width: 1500px;
    --site-layout-width: calc(
      var(--site-sidebar-width) + var(--site-layout-gap) + var(--site-page-max-width)
    );
    --site-layout-left: max(
      var(--site-layout-outer-gutter),
      calc((100vw - var(--site-layout-width)) / 2)
    );
    --site-page-available-width: calc(
      100vw
      - var(--site-layout-left)
      - var(--site-sidebar-width)
      - var(--site-layout-gap)
      - var(--site-layout-outer-gutter)
    );
  }

  body.has-site-nav .site-sidebar {
    left: var(--site-layout-left);
  }

  body.has-site-nav .page {
    width: min(
      var(--site-page-max-width),
      var(--site-page-available-width)
    );
    margin:
      18px
      var(--site-layout-outer-gutter)
      32px
      calc(var(--site-layout-left) + var(--site-sidebar-width) + var(--site-layout-gap));
  }

  body.has-site-nav .hero .hero-head > :first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  body.has-site-nav .hero .user,
  body.has-site-nav .hero .hero-user {
    flex: 0 1 min(420px, 42vw);
    min-width: min(320px, 36vw);
    margin-left: auto;
    align-items: flex-start;
    justify-content: flex-end;
  }

  body.has-site-nav .hero .user > *,
  body.has-site-nav .hero .hero-user > * {
    pointer-events: auto;
  }

  body.has-site-nav:not(.admin-page) .hero .user > :not(.site-desktop-top-search),
  body.has-site-nav:not(.admin-page) .hero .hero-user > :not(.site-desktop-top-search) {
    display: none !important;
  }

  body.has-site-nav .hero .site-hero-search-host {
    display: flex;
  }

  body.has-site-nav .hero .site-hero-search-host > :not(.site-desktop-top-search) {
    display: none !important;
  }

  body.has-site-nav .hero .site-hero-search-host .site-desktop-top-search {
    display: block;
  }
}

@media (max-width: 1040px) {
  body.has-site-nav {
    padding-top: 66px;
  }

  .site-sidebar {
    display: none;
  }

  .site-desktop-top-search {
    display: none;
  }

  body.has-site-nav .hero .user,
  body.has-site-nav .hero .hero-user {
    display: none !important;
  }

  body.admin-page .hero .hero-user {
    display: flex !important;
  }

  body.admin-page .hero .hero-user .badge,
  body.admin-page .hero .hero-user form {
    display: none !important;
  }

  .site-mobile-topbar {
    position: fixed;
    z-index: 42;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(216, 226, 239, 0.9);
    background: rgba(248, 251, 255, 0.92);
    box-shadow: 0 12px 30px rgba(18, 38, 63, 0.08);
    backdrop-filter: blur(16px);
  }

  .site-nav-toggle {
    width: 42px;
    height: 38px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    cursor: pointer;
  }

  .site-nav-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
  }

  .site-mobile-brand {
    color: var(--text);
    text-decoration: none;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
    pointer-events: none;
    user-select: none;
  }

  .site-drawer-backdrop {
    position: fixed;
    z-index: 43;
    inset: 0;
    display: block;
    background: rgba(18, 32, 51, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  .site-mobile-drawer {
    position: fixed;
    z-index: 44;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-right: 1px solid rgba(216, 226, 239, 0.9);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 26px 0 70px rgba(18, 38, 63, 0.18);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    backdrop-filter: blur(18px);
    min-height: 0;
    overflow: hidden;
  }

  .site-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .site-drawer-close {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
  }

  body.site-nav-open {
    overflow: hidden;
  }

  body.site-nav-open .site-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.site-nav-open .site-mobile-drawer {
    transform: translateX(0);
  }

  body.has-site-nav .page {
    width: calc(100vw - 14px);
    margin: 10px auto 24px;
  }

  body.has-site-nav .marked-fab {
    top: 72px;
  }
}
