/* Responsive additions to the existing public-site design. */
:root {
  --website-preview-background: #fff0c2;
  --website-content-width: 1400px;
}

.gzh-guide,
.floating-quick-links,
.website-wechat-support {
  display: none;
}

@media (min-width: 992px) and (hover: hover) and (pointer: fine) {
  .website-wechat-support {
    position: fixed;
    inset-block-start: 43%;
    /* Leave the right edge clear for the homepage carousel arrow. */
    inset-inline-end: 88px;
    z-index: 1035;
    display: flex;
    width: 72px;
    height: 72px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transform: translateY(-50%);
    border: 1px solid #cee3fb;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff 35%, #edf5ff);
    color: #12345b;
    box-shadow: 0 8px 24px rgba(12, 64, 128, 0.22);
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
  }

  .website-wechat-support:hover,
  .website-wechat-support:focus-visible {
    border-color: #539af1;
    color: #12345b;
    box-shadow: 0 8px 25px rgba(17, 102, 210, 0.3);
    text-decoration: none;
  }

  .website-wechat-support-icon {
    color: #1261be;
    font-size: 30px;
    line-height: 1;
  }

  .website-wechat-support-brand {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
  }

  .website-wechat-support-tip {
    position: absolute;
    inset-block-end: calc(100% + 14px);
    inset-inline-end: 0;
    display: grid;
    gap: 4px;
    padding: 12px 15px;
    border: 1px solid #e0ebf8;
    border-radius: 14px;
    background: #fff;
    color: #12345b;
    box-shadow: 0 6px 24px rgba(12, 64, 128, 0.16);
    text-align: start;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .website-wechat-support-tip::after {
    position: absolute;
    inset-block-end: -7px;
    inset-inline-end: 29px;
    width: 12px;
    height: 12px;
    border-inline-end: 1px solid #e0ebf8;
    border-block-end: 1px solid #e0ebf8;
    background: #fff;
    transform: rotate(45deg);
    content: "";
  }

  .website-wechat-support-tip strong {
    font-size: 15px;
    line-height: 1.35;
  }

  .website-wechat-support-tip span {
    color: #4b6075;
    font-size: 12px;
    line-height: 1.4;
  }

  .website-wechat-support:hover .website-wechat-support-tip,
  .website-wechat-support:focus-visible .website-wechat-support-tip {
    opacity: 1;
    transform: translateY(0);
  }
}

body > a.rv-feedback-floating {
  top: clamp(112px, 16vh, 152px);
  right: clamp(12px, 3vw, 44px);
  bottom: auto;
}

@media (min-width: 1760px) and (min-height: 600px) and (hover: hover) and (pointer: fine) {
  .gzh-guide,
  .floating-quick-links {
    --gutter-width: calc((100% - var(--website-content-width)) / 2);
    position: fixed;
    bottom: 24px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: min(var(--panel-width), calc(var(--gutter-width) - 24px));
    max-height: calc(100vh - 160px);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
  }

  .gzh-guide {
    --panel-width: 168px;
    left: calc(var(--gutter-width) / 2);
    transform: translateX(-50%);
  }

  .floating-quick-links {
    --panel-width: 184px;
    right: calc(var(--gutter-width) / 2);
    transform: translateX(50%);
  }

  .gzh-guide .gzh-body,
  .floating-quick-links .fl-body {
    overflow-y: auto;
  }
}

html {
  scroll-padding-top: 100px;
}

body {
  min-width: 320px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

.website-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1100;
  padding: 12px 18px;
  color: #143b70;
  background: #fff;
}

.website-skip-link:focus {
  top: 8px;
}

.website-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 16px;
  padding: 9px 16px;
  background: var(--website-preview-background);
  color: #65470d;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

main,
.row > *,
.article-body,
.product-card-body,
.card-prod-body {
  min-width: 0;
}

main h1,
main h2,
main h3,
main p,
.breadcrumb,
.attachment-name {
  overflow-wrap: anywhere;
}

.article-body img,
.article-body video,
.article-body audio,
.article-body iframe {
  max-width: 100%;
}

.article-body img {
  height: auto;
}

.article-body video {
  width: 100%;
  height: auto;
}

.article-body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 180px;
}

.website-table-scroll {
  max-width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.website-table-scroll table {
  display: table;
  min-width: 100%;
  margin: 0;
}

.article-body pre {
  max-width: 100%;
  padding: 14px;
  overflow-x: auto;
}

.pagination {
  flex-wrap: wrap;
  gap: 4px;
}

a:focus-visible,
button:focus-visible,
.website-table-scroll:focus-visible {
  outline: 3px solid #f5a623;
  outline-offset: 3px;
}

.navbar-toggler,
.theme-btn-nav {
  min-width: 44px;
  min-height: 44px;
}

.footer .col-auto {
  max-width: 100%;
}

@media (max-width: 1599px) {
  .navbar-logo {
    width: auto;
    max-width: 190px;
    flex-shrink: 1;
  }

  .navbar-logo img {
    max-width: 100%;
    height: auto;
  }

  .navbar .nav-link {
    padding-right: 8px !important;
    padding-left: 8px !important;
    font-size: 0.98rem;
  }

  .navbar-clock {
    display: none;
  }
}

@media (max-width: 1399.98px) {
  .hero-banner .hero-content {
    max-width: 100%;
    padding: 40px 24px;
  }

  .hero-banner h1,
  .hero-banner .hero-title {
    font-size: 3rem;
    white-space: normal;
  }

  .navbar > .container {
    flex-wrap: wrap;
    gap: 8px;
  }

  .navbar-collapse {
    flex-basis: 100%;
    max-height: 75vh;
    padding-bottom: 12px;
    overflow-y: auto;
  }

  .navbar-nav .nav-link,
  .navbar-nav .dropdown-item {
    min-height: 44px;
    padding-top: 11px;
    padding-bottom: 11px;
    white-space: normal;
  }

  .navbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    margin-top: 10px;
    margin-left: 0 !important;
  }

  .navbar-actions .input-group {
    width: 100%;
    flex-wrap: nowrap;
  }

  .navbar-actions .input-group > .form-control,
  .navbar-actions .input-group > .btn {
    min-height: 44px;
  }

  .navbar-actions .input-group > .btn {
    min-width: 44px;
  }

  .navbar-actions .website-nav-search {
    min-width: 0;
    max-width: none;
  }

  .navbar-actions .website-nav-search::placeholder {
    color: rgba(255, 255, 255, 0.72);
  }

  .navbar-actions .theme-btn-nav {
    grid-area: 1 / 2;
  }

  .navbar-actions [data-member-nav-entry] {
    grid-column: 1 / -1;
    justify-self: start;
  }

  main .row.g-5,
  .footer .row.g-5 {
    --bs-gutter-x: 1.5rem;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

}

@media (max-width: 991px) {
  .article-sidebar {
    position: static !important;
    margin-top: 20px;
  }

}

@media (max-width: 767px) {
  .website-preview {
    font-size: 12px;
  }

  .navbar-logo {
    max-width: 210px;
  }

  .hero-banner,
  .hero-banner .swiper-slide {
    min-height: 300px;
    height: auto;
  }

  .hero-banner .hero-content {
    padding: 34px 18px;
  }

  .hero-banner h1,
  .hero-banner .hero-title {
    font-size: 1.85rem;
    line-height: 1.5;
    white-space: normal;
  }

  .hero-banner .hero-subtitle {
    font-size: 1rem;
    line-height: 1.8;
  }

  .section-cn-title {
    font-size: 2rem;
  }

  .section-en-title {
    font-size: 0.85rem;
    letter-spacing: 2px;
  }

  .btn-primary-hero,
  .btn-fast-hero,
  .btn-outline-hero {
    max-width: 100%;
    padding: 11px 22px;
    white-space: normal;
  }

  .article-body {
    font-size: 1rem;
    line-height: 1.85;
  }

  .article-body table {
    white-space: normal;
  }

  .website-table-scroll table {
    min-width: 560px;
  }

  .pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  .footer .text-nowrap {
    white-space: normal !important;
  }

  .footer-bottom {
    padding-right: 16px;
    padding-left: 16px;
    overflow-wrap: anywhere;
  }

}

@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;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}
