/* =========================================================
   公共 Footer
   命名空间：qx-footer
   页面级样式不要再覆盖 qx-footer 内部元素。
   ========================================================= */

.qx-footer {
  --qf-ink: #07182e;
  --qf-blue: #0b63e5;
  --qf-sky: #6db8ff;
  --qf-text: rgba(255, 255, 255, 0.78);
  --qf-muted: rgba(255, 255, 255, 0.56);
  --qf-faint: rgba(255, 255, 255, 0.34);
  --qf-line: rgba(255, 255, 255, 0.12);
  --qf-pad: 24px;

  display: block;
  margin: 0;
  padding: 28px 0 0 0;
  background: var(--qf-ink);
  color: var(--qf-text);
  font-family: inherit;
  isolation: isolate;
}

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

.qx-footer a {
  color: inherit;
  text-decoration: none;
}

.qx-footer img {
  display: block;
  max-width: 100%;
  height: auto;
}

.qx-footer ul,
.qx-footer li,
.qx-footer figure {
  margin: 0;
  padding: 0;
  list-style: none;
}

.qx-footer h3,
.qx-footer p {
  margin: 0;
}

.qx-footer a:focus-visible {
  outline: 2px solid var(--qf-sky);
  outline-offset: 3px;
  border-radius: 4px;
}

.qx-footer .qx-footer-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--qf-pad);
}

/* 公共 CTA 始终按内容宽度排列，避免页面级 .hero-actions 网格规则串入 */
.qx-footer-cta .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 0;
}

.qx-footer-cta .btn {
  flex: 0 0 auto;
  width: auto;
}

/* 公共 CTA：移动端收紧节奏，按钮不挤压 */
@media (max-width: 768px) {
  .qx-footer-cta {
    padding: 52px 0 48px;
  }

  .qx-footer-cta .cta-inner h2 {
    font-size: 25px;
  }

  .qx-footer-cta .cta-inner p {
    margin-bottom: 24px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .qx-footer-cta {
    padding: 42px 0 38px;
  }

  .qx-footer-cta .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
  }

  .qx-footer-cta .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding: 12px 8px;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  .qx-footer-cta .hero-actions {
    gap: 8px;
  }

  .qx-footer-cta .btn {
    padding: 11px 6px;
    font-size: 13px;
  }
}

/* ---------- 主体 ---------- */
.qx-footer-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr;
  grid-template-areas: "brand courses resources";
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 52px;
}

.qx-footer-brand {
  grid-area: brand;
  max-width: 360px;
}

.qx-footer-brand-top,
.qx-footer-brand-left,
.qx-footer-brand-right {
  display: contents;
}

.qx-footer-col--courses {
  grid-area: courses;
}

.qx-footer-col--resources {
  grid-area: resources;
}

/* ---------- 品牌区 ---------- */
.qx-footer-logo {
  display: inline-flex;
  align-items: center;
}

.qx-footer-logo img {
  width: auto;
  height: 42px;
}

.qx-footer-statement {
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  line-height: 1.8;
}

.qx-footer-disciplines {
  margin-top: 10px;
  color: var(--qf-faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
}

.qx-footer-social-label {
  margin-top: 24px;
  color: var(--qf-faint);
  font-size: 10px;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.qx-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.qx-footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.qx-footer-social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(109, 184, 255, 0.45),
    0 8px 18px rgba(0, 0, 0, 0.24);
  filter: brightness(1.04);
}

.qx-footer-social-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}

/* ---------- 链接列 ---------- */
.qx-footer-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.qx-footer-title span {
  color: var(--qf-faint);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.qx-footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qx-footer-links a {
  display: inline-block;
  width: fit-content;
  color: var(--qf-muted);
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.2s ease, transform 0.2s ease;
}

.qx-footer-links a:hover {
  color: #fff;
  transform: translateX(2px);
}

/* ---------- 底部版权 ---------- */
.qx-footer-bottom {
  padding: 18px 0 22px;
  border-top: 1px solid var(--qf-line);
}

.qx-footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--qf-faint);
  font-size: 12px;
  line-height: 1.7;
}

.qx-footer-bottom p {
  margin: 0;
}

.qx-footer-bottom a {
  color: inherit;
}

.qx-footer-bottom a:hover {
  color: #fff;
}

/* ---------- 1200px：四栏收紧 ---------- */
@media (max-width: 1200px) {
  .qx-footer-grid {
    gap: 36px;
  }
}

/* ---------- 1024px：品牌通栏，课程与资源两栏并排 ---------- */
@media (max-width: 1024px) {
  .qx-footer-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "courses resources";
    gap: 36px 48px;
    padding-top: 42px;
    padding-bottom: 44px;
  }

  .qx-footer-brand {
    max-width: none;
  }
}

/* ---------- 768px：移动端节奏 ---------- */
@media (max-width: 768px) {
  .qx-footer {
    --qf-pad: 20px;
  }

  .qx-footer-grid {
    gap: 30px 32px;
    padding-top: 34px;
    padding-bottom: 38px;
  }

  .qx-footer-statement {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.65;
  }

  .qx-footer-social-label {
    margin-top: 20px;
  }

  .qx-footer-title {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .qx-footer-links {
    gap: 0;
  }

  .qx-footer-links a {
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 3px 0;
    font-size: 13px;
  }

  .qx-footer-bottom-inner {
    flex-direction: column;
    gap: 6px;
  }
}

/* ---------- 560px：两栏 ---------- */
@media (max-width: 560px) {
  .qx-footer {
    --qf-pad: 26px;
  }

  .qx-footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "brand brand"
      "courses resources";
    gap: 24px 50px;
    padding-top: 30px;
    padding-bottom: 32px;
  }

  .qx-footer-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .qx-footer-title span {
    display: block;
    font-size: 8px;
    letter-spacing: 0.12em;
    line-height: 1.4;
  }

  .qx-footer-logo img {
    height: 38px;
  }

  .qx-footer-brand-top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "left right"
      "disciplines disciplines";
    align-items: end;
    column-gap: 16px;
    row-gap: 10px;
  }

  .qx-footer-brand-left {
    grid-area: left;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
  }

  .qx-footer-brand-right {
    grid-area: right;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: end;
  }

  .qx-footer-brand-top > .qx-footer-disciplines {
    grid-area: disciplines;
    margin-top: 0;
  }

  .qx-footer-brand-right .qx-footer-social-label {
    margin-top: 0;
  }

  .qx-footer-social {
    width: auto;
    margin-top: 8px;
  }

  .qx-footer-social-link {
    flex: 0 0 auto;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
  }

  .qx-footer-social-img {
    border-radius: 10px;
  }

  .qx-footer-bottom {
    padding: 16px 0 20px;
  }

  .qx-footer-bottom-inner {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qx-footer * {
    transition: none !important;
  }

  .qx-footer-social-link:hover,
  .qx-footer-links a:hover {
    transform: none;
  }
}
