/* ============================================
   Shared Components — 荟萃英才教育静态站
   Mobile-first / Breakpoints: sm=640 md=768 lg=1024 xl=1280
   Uses CSS custom properties from variables.css
   ============================================ */


/* ===========================================
   1. NAVBAR
   =========================================== */

.navbar {
  width: 100%;
  background-color: var(--primary-500);
  position: relative;
  z-index: 100;
}

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .navbar-inner {
    gap: 10%;
  }
}

@media (min-width: 1280px) {
  .navbar-inner {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Brand area: logo + hamburger */
.navbar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

/* Logo */
.navbar-logo {
  display: flex;
  align-items: center;
}

.navbar-logo img {
  width: 105px;
  height: 44px;
  object-fit: contain;
}

@media (min-width: 640px) {
  .navbar-logo img {
    width: 129px;
    height: 54px;
  }
}

@media (min-width: 768px) {
  .navbar-logo img {
    width: 153px;
    height: 64px;
  }
}

/* Hamburger toggle */
.navbar-hamburger {
  display: flex;
  cursor: pointer;
  margin-left: 1rem;
}

@media (min-width: 768px) {
  .navbar-hamburger {
    display: none;
  }
}

.navbar-hamburger input {
  display: none;
}

.navbar-hamburger svg {
  width: 1.5rem;
  height: 1.5rem;
  color: #fff;
}

/* Mobile menu panel — hidden by default */
.navbar-menu {
  display: none;
  position: absolute;
  width: 100%;
  left: 0;
  top: 100%;
  z-index: 100;
  background-color: var(--primary-500);
}

/* CSS :has() — show menu when checkbox is checked */
.navbar-inner:has(.navbar-hamburger input:checked) .navbar-menu {
  display: block;
}

@media (min-width: 768px) {
  .navbar-menu {
    position: relative;
    display: block;
    top: auto;
    left: auto;
    width: auto;
    flex: 1;
  }
}

/* Menu inner layout */
.navbar-menu-inner {
  background-color: var(--primary-500);
  padding-top: 2rem;
  padding-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .navbar-menu-inner {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
  }
}

/* Navigation links list */
.navbar-links {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  align-items: center;
}

@media (min-width: 768px) {
  .navbar-links {
    flex-direction: row;
    gap: 0;
    justify-content: center;
  }
}

/* Individual nav link */
.nav-link {
  display: block;
  color: #fff;
  text-align: center;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  font-size: 1rem;
  transition: opacity 0.15s;
}

.nav-link:hover {
  opacity: 0.8;
}

@media (min-width: 768px) {
  .nav-link {
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .nav-link {
    font-size: 1.125rem;
  }
}

/* Active state */
.nav-link--active {
  font-weight: 700;
  opacity: 1;
}

@media (min-width: 768px) {
  .nav-link--active {
    border-bottom: 2px solid #fff;
  }
}

/* Telephone block */
.navbar-tel {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  font-size: 0.875rem;
}

.navbar-tel svg {
  width: 1rem;
  height: 1rem;
}

.navbar-tel a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
}

/* Mobile backdrop overlay */
.navbar-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

@media (min-width: 768px) {
  .navbar-backdrop {
    display: none;
  }
}


/* ===========================================
   2. FOOTER
   =========================================== */

.footer {
  background-color: #000;
  padding: 0 1rem;
}

/* Footer navigation links */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-size: 0.875rem;
}

.footer-links a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--primary-400);
}

/* Copyright line */
.footer-copyright {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  border-top: 1px solid var(--gray-800);
  color: var(--gray-400);
  font-size: 0.875rem;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-copyright {
    flex-direction: row;
    gap: 0;
    column-gap: 1rem;
  }
}

.footer-copyright a {
  color: var(--gray-400);
  text-decoration: none;
}

.footer-copyright a:hover {
  color: var(--gray-300);
}

.footer-icp-label {
  display: none;
}

@media (min-width: 768px) {
  .footer-icp-label {
    display: inline;
  }
}


/* ===========================================
   3. GO-TOP SIDEBAR
   =========================================== */

/* Mobile: full-width bottom bar */
.gotop-sidebar {
  width: 100%;
  height: 3.5rem;
  display: flex;
  background-color: #fff;
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Desktop: fixed right sidebar */
@media (min-width: 640px) {
  .gotop-sidebar {
    width: 5.5rem;
    height: auto;
    position: fixed;
    right: 2rem;
    top: auto;
    bottom: 2rem;
    flex-direction: column;
    border-radius: 0.375rem;
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 999;
    overflow: hidden;
  }
}

/* Sidebar buttons — shared base */
.gotop-consult-btn,
.gotop-wechat-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.gotop-consult-btn {
  border-right: 1px solid var(--gray-200);
}

@media (min-width: 640px) {
  .gotop-consult-btn,
  .gotop-wechat-btn {
    width: 100%;
    flex-direction: column;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
  }
}

/* Back-to-top button — hidden on mobile until JS shows it */
.gotop-back-btn {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.5s;
}

/* Mobile: floating circle */
@media (max-width: 639px) {
  .gotop-back-btn {
    position: fixed;
    right: 1rem;
    bottom: 7.5rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.25rem;
    background-color: var(--primary-500);
    border-radius: 9999px;
  }
}

@media (min-width: 640px) {
  .gotop-back-btn {
    width: 100%;
    border-bottom: none;
  }
}

/* Icon containers */
.gotop-icon {
  width: 2rem;
  height: 2rem;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gotop-icon svg {
  width: 100%;
  height: 100%;
}

@media (min-width: 640px) {
  .gotop-icon {
    width: 3rem;
    height: 3rem;
    padding: 0.5rem;
    border-radius: 9999px;
    background-color: var(--primary-500);
  }

  .gotop-icon svg {
    color: #fff;
  }
}

/* Primary-colored icon on mobile (blue SVG), white on desktop */
.gotop-icon-primary svg {
  color: var(--primary-500);
}

@media (min-width: 640px) {
  .gotop-icon-primary svg {
    color: #fff;
  }
}

/* Circle variant for back-to-top on mobile */
.gotop-icon-circle {
  background-color: var(--primary-500);
  border-radius: 9999px;
}

.gotop-icon-circle svg {
  color: #fff;
}

@media (min-width: 640px) {
  .gotop-icon-circle {
    background-color: var(--primary-500);
  }
}

/* Labels under icons */
.gotop-sidebar p {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin: 0.125rem 0 0;
}

@media (max-width: 639px) {
  .gotop-sidebar p {
    font-size: 0.75rem;
    margin-left: 0.25rem;
  }

  .gotop-back-btn p {
    display: none;
  }
}

@media (min-width: 640px) {
  .gotop-sidebar p {
    font-size: 0.625rem;
    text-align: center;
  }
}

/* Hover effects */
.gotop-consult-btn:hover,
.gotop-wechat-btn:hover,
.gotop-back-btn:hover {
  color: var(--primary-500);
}


/* ===========================================
   4. QR CODE MODAL
   =========================================== */

.qrcode-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.qrcode-modal--visible {
  display: flex;
}

/* Backdrop */
.qrcode-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

/* Card */
.qrcode-modal-card {
  width: 25rem;
  min-height: 20rem;
  max-height: 90%;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Header with gradient */
.qrcode-modal-header {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  background: linear-gradient(to bottom, var(--primary-500), var(--primary-600));
  position: relative;
}

/* Close button */
.qrcode-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  cursor: pointer;
  background-color: var(--gray-300);
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  transition: background-color 0.15s;
}

.qrcode-modal-close:hover {
  background-color: var(--gray-400);
}

.qrcode-modal-close svg {
  width: 100%;
  height: 100%;
}

/* Title */
.qrcode-modal-title {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* QR image wrapper */
.qrcode-modal-img-wrapper {
  margin: 1.5rem auto;
  width: 11.25rem;
  height: 11.25rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  overflow: hidden;
}

.qrcode-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Subtitle */
.qrcode-modal-subtitle {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 1.25rem;
  color: #fff;
}


/* ===========================================
   5. LINKS SECTION (Homepage / About)
   =========================================== */

.links-section {
  width: 100%;
  padding-top: 2rem;
  padding-bottom: 2rem;
  background-color: #000;
  color: var(--gray-200);
}

@media (min-width: 768px) {
  .links-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

.links-inner {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.links-content {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .links-content {
    flex-direction: row;
  }
}

/* Left column */
.links-left {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .links-left {
    width: auto;
  }
}

/* Logo in links section */
.links-logo {
  display: flex;
}

.links-logo img {
  width: 105px;
  height: 44px;
  object-fit: contain;
}

@media (min-width: 640px) {
  .links-logo img {
    width: 129px;
    height: 54px;
  }
}

@media (min-width: 768px) {
  .links-logo img {
    width: 153px;
    height: 64px;
  }
}

/* Slogan */
.links-slogan {
  max-width: 28rem;
  font-weight: 700;
  font-size: 1.25rem;
  font-style: italic;
  margin: 0;
}

@media (min-width: 768px) {
  .links-slogan {
    font-size: 1.875rem;
  }
}

.links-subtitle {
  margin: 0;
}

/* Right column: QR codes */
.links-right {
  display: flex;
  width: 100%;
  flex-direction: row;
  gap: 1rem;
  justify-content: space-around;
}

@media (min-width: 768px) {
  .links-right {
    width: auto;
  }
}

.links-qrcode-item {
  text-align: center;
}

.links-qrcode-item img {
  width: 7.5rem;
  height: 7.5rem;
  object-fit: cover;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .links-qrcode-item img {
    width: 120px;
    height: 120px;
  }
}

.links-qrcode-item p {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}


/* ===========================================
   6. PAGINATION (Article list pages)
   =========================================== */

.pagination {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: 3rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .pagination {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.pagination-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Pagination button (page numbers + arrows) */
.pagination-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  transition: all 0.15s;
  text-decoration: none;
  color: var(--gray-600);
}

@media (min-width: 768px) {
  .pagination-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
  }
}

.pagination-btn:hover {
  color: var(--blue-5);
  background-color: var(--blue-2);
}

/* Active page */
.pagination-active {
  background-color: var(--blue-5);
  color: #fff;
}

.pagination-active:hover {
  background-color: var(--blue-5);
  color: #fff;
}

/* Disabled arrows */
.pagination-disabled {
  cursor: not-allowed;
}

.pagination-disabled:hover {
  color: var(--gray-500);
  background-color: var(--gray-100);
}

/* Ellipsis */
.pagination-ellipsis {
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}

@media (min-width: 768px) {
  .pagination-ellipsis {
    width: 2rem;
    height: 2rem;
  }
}
