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

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

body.qx-body {
  margin: 0;
  font-family: var(--qx-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--qx-text);
  background: var(--qx-bg);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

body.qx-body.qx-has-tab {
  padding-bottom: calc(var(--qx-tab-h) + env(safe-area-inset-bottom, 0));
}

.qx-skip {
  position: absolute;
  left: -9999px;
}

.qx-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--qx-header-h);
  background: var(--qx-card);
  border-bottom: 1px solid var(--qx-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.qx-header-inner {
  max-width: var(--qx-max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.qx-logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 160px;
}

.qx-nav-desktop {
  display: none;
  flex: 1;
  gap: 4px;
  margin-left: 16px;
}

.qx-nav-desktop a {
  padding: 8px 14px;
  color: var(--qx-text);
  text-decoration: none;
  border-radius: var(--qx-radius-sm);
  font-size: 15px;
}

.qx-nav-desktop a:hover,
.qx-nav-desktop a.is-active {
  color: var(--qx-brand);
  background: var(--qx-brand-light);
}

.qx-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.qx-main {
  max-width: var(--qx-max-w);
  margin: 0 auto;
  padding: 16px;
  min-height: calc(100vh - var(--qx-header-h) - 80px);
}

.qx-tabbar {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: var(--qx-tab-h);
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--qx-card);
  border-top: 1px solid var(--qx-border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
}

.qx-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--qx-text-muted);
  text-decoration: none;
}

.qx-tabbar a.is-active {
  color: var(--qx-brand);
  font-weight: 600;
}

.qx-tabbar-icon {
  font-size: 20px;
  line-height: 1;
}

.qx-footer-site {
  max-width: var(--qx-max-w);
  margin: 24px auto 0;
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--qx-text-muted);
}

.qx-footer-site a {
  color: var(--qx-text-secondary);
}

.qx-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.qx-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
}

.qx-sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}

.qx-sheet.is-open .qx-sheet-mask {
  opacity: 1;
}

.qx-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--qx-card);
  border-radius: var(--qx-radius) var(--qx-radius) 0 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  padding: 16px 0 calc(16px + env(safe-area-inset-bottom, 0));
}

.qx-sheet.is-open .qx-sheet-panel {
  transform: translateY(0);
}

.qx-sheet-title {
  text-align: center;
  font-weight: 600;
  padding: 8px 16px 16px;
  border-bottom: 1px solid var(--qx-border);
}

.qx-sheet-item {
  display: block;
  padding: 14px 20px;
  color: var(--qx-text);
  text-decoration: none;
  border-bottom: 1px solid var(--qx-border);
}

.qx-sheet-cancel {
  display: block;
  margin: 8px 16px 0;
  padding: 12px;
  text-align: center;
  background: var(--qx-bg);
  border-radius: var(--qx-radius-sm);
  color: var(--qx-text-secondary);
  text-decoration: none;
}

@media (min-width: 768px) {
  body.qx-body.qx-has-tab {
    padding-bottom: 0;
  }

  body.qx-env-pc {
    min-width: 1024px;
  }

  .qx-nav-desktop {
    display: flex;
  }

  .qx-tabbar {
    display: none;
  }

  .qx-btn-menu-mobile {
    display: none !important;
  }

  .qx-main {
    padding: 24px;
  }

  .qx-env-pc .qx-header-actions .qx-btn-sm {
    min-width: 72px;
  }
}

@media (max-width: 767px) {
  .qx-nav-desktop {
    display: none !important;
  }
}
