/* =========================================================
   深圳市人才政策一码通 — 全端自适应
   基准：手机竖屏 H5，最大宽 500px；高度不足时可滚动
   ========================================================= */

:root {
  --page-max: 500px;
  /* 页面逻辑宽度：手机全宽，大屏不超过 500 */
  --page-w: min(100vw, var(--page-max));
  /* 真实可视高度：优先动态视口，避免 iOS 地址栏问题 */
  --vh: 1vh;
  --app-h: 100vh;
  --blue: #2266e3;
  --blue-deep: #174cec;
  --sp-3: calc(var(--page-w) * 0.025);
  --sp-6: calc(var(--page-w) * 0.06);
  --sp-14: calc(var(--page-w) * 0.14);
  --sp-16: calc(var(--page-w) * 0.16);
  --sp-32: calc(var(--page-w) * 0.32);
  --banner-w: calc(var(--page-w) * 0.4);
  --banner-w-60: calc(var(--page-w) * 0.6);
  --grid-w: 78%;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  width: 100%;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  background-color: var(--blue);
  color: #fff;
  /* 页面滚动交给 .app-container，避免双滚动条 */
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, sans-serif;
  font-weight: 400;
  touch-action: manipulation;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

a {
  text-decoration: none;
  color: inherit;
  -webkit-touch-callout: none;
}

/* ---------- 主壳：居中手机宽度，可滚动 ---------- */
.app-container {
  position: relative;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-h, 100dvh);
  height: 100vh;
  height: 100dvh;
  height: var(--app-h, 100dvh);
  background-color: var(--blue);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  /* 刘海屏左右安全区 */
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* 大屏：视觉上像手机壳 */
@media (min-width: 501px) {
  body {
    background: #0d3a9e;
  }
  .app-container {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 40px rgba(0, 0, 0, 0.28);
  }
}

.page-container {
  position: relative;
  width: 100%;
  min-height: 100%;
  background-color: var(--blue);
}

/* =========================================================
   首页
   ========================================================= */
.page-home-index {
  position: relative;
  width: 100%;
  min-height: 100%;
  min-height: var(--app-h, 100dvh);
  /* 关键内容区 + 页脚，高度不够时由 app-container 滚动 */
  display: flex;
  flex-direction: column;
  overflow: visible;
  background-color: #0a2a7a;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

.page-bg-fixed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: top center;
  z-index: 0;
}

.page-bg-half-bottom {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  bottom: 0;
  width: 100%;
  height: auto;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center bottom;
  opacity: 0.7;
  z-index: 2;
  pointer-events: none;
}

.pilar-container {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 6%;
  min-width: 14px;
  max-width: 28px;
  height: 42%;
  z-index: 1;
  pointer-events: none;
}

.pilar-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* 主内容：相对定位，可随高度压缩，不再绝对居中裁切 */
.home-main,
.anchor-center {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    clamp(12px, 4vh, 36px)
    4%
    clamp(8px, 2vh, 20px);
  gap: 0;
}

.home-main > a,
.anchor-center > a {
  display: block;
  width: min(60%, 280px);
  line-height: 0;
  flex-shrink: 0;
}

.home-main .banner-image,
.anchor-center .banner-image {
  display: block;
  width: 100%;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* 各元素自身宽度比例（相对父级 60% 链外的图片） */
.home-main > .banner-image.wp-50,
.anchor-center > .banner-image.wp-50 {
  width: min(50%, 220px);
}
.home-main > .banner-image.wp-90,
.anchor-center > .banner-image.wp-90 {
  width: min(90%, 420px);
}
.home-main > .banner-image.wp-60,
.anchor-center > .banner-image.wp-60 {
  width: min(60%, 280px);
}

/* 间距改用相对单位，矮屏自动收紧 */
.home-gap-sm { margin-top: clamp(-10px, -1.2vh, -6px) !important; }
.home-gap-md { margin-top: clamp(8px, 2.2vh, 24px) !important; }
.home-gap-lg { margin-top: clamp(14px, 3.5vh, 48px) !important; }
.home-gap-neg { margin-top: clamp(-18px, -2vh, -10px) !important; }

/* 兼容旧 class 名 */
.mt-n8 { margin-top: clamp(-10px, -1.2vh, -6px) !important; }
.mt-n16 { margin-top: clamp(-18px, -2vh, -10px) !important; }
.mt-24 { margin-top: clamp(8px, 2.2vh, 24px) !important; }
.mt-48 { margin-top: clamp(14px, 3.5vh, 48px) !important; }

.wp-50 { width: 50%; }
.wp-60 { width: 60%; }
.wp-90 { width: 90%; }

/* 「更多信息」 */
.home-main a.more-info-btn,
.anchor-center a.more-info-btn {
  width: min(60%, 280px);
  margin-top: clamp(8px, 1.5vh, 14px);
  line-height: 1.2;
  text-align: center;
  font-size: clamp(14px, 4vw, 17px);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(90deg, #4e82fe, #3369e2);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: clamp(0.55em, 1.4vh, 0.75em) 1em;
  box-shadow: 0 6px 16px rgba(0, 30, 100, 0.35);
  transition: transform 0.1s ease, opacity 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
}

.home-main a.more-info-btn:active,
.anchor-center a.more-info-btn:active {
  transform: scale(0.96);
}

/* 页脚：文档流底部，不再和按钮重叠 */
.home-footer,
.footer-container {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  width: min(70%, 340px);
  margin: 0 auto;
  padding-bottom: max(12px, var(--safe-bottom));
  padding-top: 4px;
  pointer-events: none;
}

.home-footer img,
.footer-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* 飞入动画 */
.fly-in {
  opacity: 0;
  transform: translateY(6vh);
  transition: opacity 0.5s linear, transform 0.5s cubic-bezier(0, 0.6, 0.33, 1);
  will-change: opacity, transform;
}
.fly-in.visible {
  opacity: 1;
  transform: translate(0);
}
.fly-in.delay-1 { transition-delay: 0.1s; }
.fly-in.delay-2 { transition-delay: 0.2s; }
.fly-in.delay-3 { transition-delay: 0.3s; }
.fly-in.delay-4 { transition-delay: 0.4s; }
.fly-in.delay-5 { transition-delay: 0.5s; }

.z-0 { z-index: 0; }
.z-1 { z-index: 1; }
.z-2 { z-index: 2; }
.z-3 { z-index: 3; }
.z-4 { z-index: 4; }

/* 极矮屏（如横屏手机、小屏）：再压缩 */
@media (max-height: 640px) {
  .home-main,
  .anchor-center {
    justify-content: flex-start;
    padding-top: max(8px, var(--safe-top));
  }
  .pilar-container {
    height: 30%;
    opacity: 0.85;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .home-main,
  .anchor-center {
    flex-wrap: nowrap;
    padding-top: 6px;
  }
  .home-main > .banner-image.wp-90,
  .anchor-center > .banner-image.wp-90 {
    width: min(50%, 280px);
  }
  .home-main > a,
  .anchor-center > a,
  .home-main a.more-info-btn {
    width: min(40%, 220px);
  }
}

/* =========================================================
   列表页（市级 / 区级）
   ========================================================= */
.page-list {
  min-height: 100%;
  padding-bottom: calc(var(--sp-14) + var(--safe-bottom) + 24px);
}

.page-list .page-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.buttons-grid {
  position: relative;
  z-index: 1;
  width: var(--grid-w);
  max-width: 100%;
  margin: 0 auto;
  padding-top: var(--sp-16);
  padding-bottom: calc(var(--sp-6) + 28px + var(--safe-bottom));
}

.page-area .buttons-grid {
  padding-top: var(--sp-32);
}

.banner-image {
  display: block;
  height: auto;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.page-list .banner-image.wvw-40,
.banner-image.wvw-40 {
  width: var(--banner-w);
}

.page-list .banner-image.wvw-60,
.banner-image.wvw-60 {
  width: var(--banner-w-60);
}

.fluid-image {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.one-column-row {
  width: 100%;
}
.one-column-row a,
.two-column-row .button-grid a,
.three-column-row .button-grid a {
  display: block;
  width: 100%;
  line-height: 0;
}

.two-column-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 2%;
}

.page-policy .two-column-row .button-grid {
  width: 49%;
  flex: 0 0 49%;
}

.page-area .two-column-row .button-grid:first-child {
  width: 35%;
  flex: 0 0 35%;
}
.page-area .two-column-row .button-grid:last-child {
  width: 55%;
  flex: 0 0 55%;
}

.three-column-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 3%;
}
.three-column-row .button-grid {
  width: 30%;
  flex: 0 0 30%;
}

.mt-vw3 { margin-top: var(--sp-3) !important; }
.mt-vw6 { margin-top: var(--sp-6) !important; }
.mt-vw16 { margin-top: var(--sp-16) !important; }
.mt-vw32 { margin-top: var(--sp-32) !important; }
.mb-vw6 { margin-bottom: var(--sp-6) !important; }

.clickable {
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.clickable:active {
  transform: scale(0.96);
  opacity: 0.92;
}

/* 返回：贴在内容壳右侧，兼容安全区 */
.go-back-button {
  position: fixed;
  right: max(var(--safe-right), calc((100vw - min(100vw, var(--page-max))) / 2));
  bottom: calc(var(--sp-14) + var(--safe-bottom));
  font-size: clamp(14px, calc(var(--page-w) * 0.042), 16px);
  line-height: 1;
  color: var(--blue-deep);
  background-color: #fff;
  border-top-left-radius: 32px;
  border-bottom-left-radius: 32px;
  font-weight: 600;
  padding: 12px 12px 12px 22px;
  z-index: 99;
  box-shadow: 1px 1px 5px #0000004d;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* =========================================================
   详情页
   ========================================================= */
.common-page {
  width: 100%;
  height: auto;
}
.common-page .heading-image {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.common-page .page-content {
  padding: clamp(0.55rem, 2.2vw, 0.8rem);
}
.common-page .page-content img.talent {
  margin-bottom: -1px;
  width: 100%;
  display: block;
  height: auto;
}
.common-page .page-content .gradient {
  background: linear-gradient(180deg, #e4f5ff, #9dddfe);
  padding: clamp(0.55rem, 2.2vw, 0.8rem);
  border-radius: 0.4rem;
}
.common-page .page-content .gradient.talent-flag {
  border-top-right-radius: 0;
}
.common-page .page-content .gradient .sequence {
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: #3f3f3f;
  font-size: clamp(0.88rem, 2.7vw, 1rem);
  line-height: 1.75;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.common-page .page-content .gradient .sequence:first-child {
  margin-top: 0;
}
.common-page .page-content .gradient .sequence .contact,
.common-page .page-content .gradient .sequence .plain {
  padding: 0 0.5rem;
}
.common-page .page-content .gradient .sequence .heading {
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  max-width: 90%;
  margin: 0.5rem auto;
  padding: 0.5rem 0 0;
  text-align: center;
}
.common-page .page-content .gradient .sequence .centered {
  padding: 0 0.5rem;
  text-align: center;
}
.common-page .page-content .gradient .sequence img.image {
  width: 100%;
  height: auto;
  display: block;
}
.common-page .page-content .gradient .sequence .qr-code {
  width: 40%;
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto;
  box-shadow: 0 0.4rem 0.4rem #0000001a;
}
.common-page .page-content .gradient .sequence .qr-codes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.common-page .page-content .gradient .sequence .qr-codes .qr-code-item {
  width: 40%;
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.common-page .page-content .gradient .sequence .section {
  font-size: clamp(0.95rem, 3.2vw, 1.2rem);
  border-radius: 0.3rem;
  line-height: 1.5;
  color: #fff;
  background: linear-gradient(90deg, #4e82fe, #3369e2);
  padding: 0.35rem 0.35rem 0.35rem 2.2rem;
  position: relative;
}
.common-page .page-content .gradient .sequence .section .section-interior {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.common-page .page-content .gradient .sequence .section .section-interior .section-right {
  line-height: 1.2;
  font-size: clamp(0.68rem, 2.1vw, 0.8rem);
  background-color: #e3f5ff;
  color: #3369e2;
  border-radius: 0.2rem;
  padding: 0.2rem 0.4rem;
  margin-right: 0.2rem;
  white-space: normal;
}
.common-page .page-content .gradient .sequence .section:before {
  content: " ";
  width: 0.9rem;
  height: 0.9rem;
  background-color: #e4f5ff;
  border-radius: 50%;
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
}
.common-page .page-content .gradient .sequence .seq-hr {
  height: 1px;
  width: calc(100% - 1rem);
  display: block;
  margin: 0 auto;
  background-color: #2266e2;
}
.common-page .page-content .gradient .sequence .contact {
  color: #2266e2;
}
.common-page .page-content .gradient .sequence .contact.c-centered {
  text-align: center;
}
.common-page .page-content .gradient .sequence .contact.c-bold {
  font-weight: 600;
  font-size: clamp(1rem, 3.2vw, 1.2rem);
}
.common-page .page-content .gradient .sequence .dual-qr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.common-page .page-content .gradient .sequence .dual-qr .qr-single {
  width: 50%;
}
.common-page .page-content .gradient .sequence .dual-qr .qr-single img {
  width: 80%;
  max-width: 140px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.common-page .page-content .gradient .sequence .dual-qr .qr-single .qr-name {
  text-align: center;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}
.link {
  display: block;
  width: calc(100% - 1rem);
  margin: 0 auto;
  font-weight: 400;
}

/* 高层次人才 tabs */
.high-level-heading {
  position: relative;
  width: 100%;
  line-height: 0;
}
.high-level-heading > img,
.high-level-heading .page-bg-image {
  position: relative !important;
  top: auto;
  left: auto;
  width: 100%;
  height: auto;
  min-height: 0;
  display: block;
  object-fit: initial;
  pointer-events: none;
}
.high-level-heading .high-level-tab {
  position: absolute;
  bottom: 0;
  width: 90%;
  left: 5%;
  display: flex;
  align-items: flex-end;
}
.high-level-heading .high-level-tab .tab-item {
  cursor: pointer;
  margin-left: -0.25%;
  margin-right: -0.25%;
  transition: transform 0.2s ease;
  flex: 1;
  line-height: 0;
}
.high-level-heading .high-level-tab .tab-item:active {
  transform: translate(2px, 2px);
}
.high-level-heading .high-level-tab .tab-item img {
  display: block;
  width: 100%;
  height: auto;
}
.contents {
  width: 100%;
  min-height: 30vh;
  position: relative;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

@media (max-width: 360px) {
  :root {
    --grid-w: 84%;
  }
  .common-page .page-content .gradient .sequence .section {
    padding-left: 1.9rem;
  }
}
