/* 网页离线版与 iPad 适配；仅在浏览器环境生效，不影响桌面安装包布局。 */
.header-offline-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.header-offline-btn:hover,
.header-offline-btn:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.header-offline-btn[hidden] {
  display: none;
}

body.desktop-runtime .header-offline-btn {
  display: none;
}

@media (max-width: 1100px) {
  html,
  body {
    min-height: 100%;
    height: auto;
    overflow: auto;
  }

  #app-wrapper {
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  #top-header {
    height: auto;
    min-height: 58px;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px 12px;
  }

  .header-center {
    order: 3;
    flex: 1 0 100%;
    margin: 0;
  }

  .header-right {
    margin-left: auto;
    gap: 6px;
  }

  .font-size-group,
  .header-theme-select {
    display: none;
  }

  #app-body {
    display: block;
    overflow: visible;
  }

  #nav-primary {
    width: 100%;
    min-height: 51px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-menu {
    display: flex;
    min-width: max-content;
    align-items: stretch;
  }

  .nav-item {
    min-width: 82px;
    min-height: 51px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .nav-item.active {
    border-left: 0;
    border-bottom-color: #fff;
  }

  .nav-account-actions {
    display: none;
  }

  #nav-secondary {
    width: 100%;
    height: min(40dvh, 330px);
    min-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  #main-content {
    min-height: 55dvh;
  }

  .content-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
    min-height: 54px;
    padding: 8px 12px;
  }

  .toolbar-left-info {
    min-width: 0;
    flex: 1 1 170px;
  }

  .article-main-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toolbar-right-actions {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 1px;
  }

  .content-body {
    padding: 16px 14px 32px;
  }

  #app-footer {
    min-height: 36px;
  }
}

@media (max-width: 520px) {
  .app-version,
  .offline-badge {
    display: none;
  }

  .header-offline-btn {
    font-size: 11px;
    padding: 0 8px;
  }

  #nav-secondary {
    height: 300px;
  }

  .sec-body-columns {
    grid-template-columns: minmax(116px, 42%) 1fr;
  }

  .article-main-title {
    font-size: 17px;
  }
}
