@media (max-width: 860px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body {
    overflow-x: hidden;
  }

  body * {
    min-width: 0;
  }

  img,
  video,
  canvas,
  svg,
  iframe {
    max-width: 100%;
  }

  table {
    max-width: 100%;
  }

  input,
  textarea,
  select,
  button {
    font-size: max(16px, 1em);
  }

  button,
  [role="button"],
  a,
  input,
  textarea,
  select {
    touch-action: manipulation;
  }

  .wrap,
  .page,
  .content,
  .main,
  .site,
  .shell,
  .article,
  .container,
  .top-inner,
  .header,
  .nav-inner,
  .footer {
    width: 100% !important;
    max-width: 100% !important;
  }

  .search,
  .search-box,
  .search-result {
    max-width: 100% !important;
  }

  .wrap,
  .page,
  .content,
  .main,
  .site,
  .shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .top-inner,
  .nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .search input,
  .search-box input {
    min-width: 0;
  }

  pre,
  code,
  .hash,
  .code,
  .mono,
  .addr,
  .record,
  .trace {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .card,
  .panel,
  .post,
  .reply,
  .note,
  .doc,
  .notepad,
  .phone,
  .gate,
  .monitor {
    max-width: 100%;
  }

  .pw-layer .panel,
  .login-panel,
  .dialog,
  .wx-modal {
    min-width: 0 !important;
    width: min(100%, 420px) !important;
  }

  .body,
  .post-body,
  .reply-body,
  .rbody,
  .panel-body,
  .doc-layer .body {
    overflow-wrap: anywhere;
  }

  .attachment,
  .file-main {
    flex-wrap: wrap;
  }

  html.embedded,
  html.embedded body {
    width: 100%;
    min-height: 100%;
  }

  body.embedded {
    margin: 0 !important;
  }

  body.embedded:not(:has(.wx-container)) {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.embedded .top,
  body.embedded .nav,
  body.embedded .forum-head,
  body.embedded .crumbs,
  body.embedded .crumb,
  body.embedded .footer {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.embedded .wrap,
  body.embedded .page,
  body.embedded .content,
  body.embedded .main,
  body.embedded .site,
  body.embedded .article,
  body.embedded .post-wrap,
  body.embedded .reply-wrap,
  body.embedded .question,
  body.embedded .answer {
    max-width: 100% !important;
  }

  body.embedded .wrap,
  body.embedded .main,
  body.embedded .site,
  body.embedded .content {
    gap: 10px !important;
  }

  body.embedded .main:has(.main-left):has(.main-right) {
    display: block !important;
  }

  body.embedded .main-left,
  body.embedded .main-right {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    float: none !important;
  }

  body.embedded .main-right {
    margin-top: 10px !important;
    border-left: 0 !important;
  }

  body.embedded .side,
  body.embedded .sidebar,
  body.embedded aside {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.embedded aside.panel {
    display: flex !important;
  }

  body.embedded aside.rail {
    display: grid !important;
  }

  body.embedded .post-wrap,
  body.embedded .reply-wrap,
  body.embedded .question,
  body.embedded .answer,
  body.embedded .panel,
  body.embedded .card {
    box-shadow: none !important;
  }
}

@media (max-width: 640px) {
  body {
    padding-left: max(env(safe-area-inset-left), 0px);
    padding-right: max(env(safe-area-inset-right), 0px);
  }

  img {
    height: auto;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.embedded table.reply {
    display: table !important;
    width: 100% !important;
    table-layout: fixed;
    overflow: visible;
  }

  body.embedded table.reply tr {
    display: table-row !important;
  }

  body.embedded table.reply td {
    display: table-cell !important;
  }

  body.embedded table.reply .floor {
    width: 42px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  body.embedded table.reply .info,
  body.embedded table.reply .avatar-col {
    width: 82px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  body.embedded table.reply .info .ip {
    display: none !important;
  }

  th,
  td {
    overflow-wrap: anywhere;
  }

  input,
  textarea,
  select,
  button {
    max-width: 100%;
  }

  button,
  input[type="button"],
  input[type="submit"],
  .btn {
    min-height: 40px;
  }

  .top-inner,
  .header,
  .nav-inner,
  .wrap,
  .page,
  .content,
  .main,
  .site,
  .shell,
  .article,
  .footer {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .sidebar,
  aside {
    max-width: 100%;
  }

  body.embedded:not(:has(.wx-container)) {
    padding: 0 !important;
  }

  body.embedded .wrap,
  body.embedded .page,
  body.embedded .content,
  body.embedded .main,
  body.embedded .site,
  body.embedded .shell,
  body.embedded .article {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body.embedded .top,
  body.embedded .header,
  body.embedded .nav,
  body.embedded .bar,
  body.embedded .forum-head {
    border-left: 0 !important;
    border-right: 0 !important;
  }

  body.embedded .header,
  body.embedded .top-inner,
  body.embedded .nav-inner {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  body.embedded .question,
  body.embedded .answer,
  body.embedded .post,
  body.embedded .reply,
  body.embedded .post-body,
  body.embedded .reply-body,
  body.embedded .panel-body {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  body.embedded .attachment,
  body.embedded .file-main {
    align-items: flex-start;
  }

  body.embedded .download,
  body.embedded .btn,
  body.embedded button {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .search,
  .search-box {
    flex-wrap: wrap;
  }

  .search input,
  .search-box input {
    width: 100% !important;
    flex: 1 1 100%;
  }

  .search button,
  .search-box button {
    flex: 1 1 auto;
  }
}
