/*
 * 嘉才集团官网 · 手机竖版版式
 * ------------------------------------------------------------------
 * 本文件把整站固定为「手机竖屏」单列版式，并且是唯一的版式：
 *   1. 所有内容收进一条 --shell 宽的竖栏，桌面浏览器里居中显示，
 *      两侧留深色机身底，手机上则天然满屏；
 *   2. 把 styles.css / pages.css / equity-financing.css 里
 *      640 / 900 / 1024 三档「桌面增强」重置回手机版式（不删原规则，
 *      日后要恢复桌面版只需删掉本文件的引用）；
 *   3. 对照表在窄栏里转成卡片式，避免横向滚动；
 *   4. 补上手机端的可达性细节：44px 触控目标、底部快捷条、
 *      安全区、iOS 输入框不缩放。
 *
 * 加载顺序（必须最后）：
 *   styles.css → pages.css → [equity-financing.css] → mobile.css
 * ------------------------------------------------------------------
 */

/* ---------- 1. 手机竖屏画布 ---------- */

:root {
  --shell: 460px; /* 手机竖屏内容宽度，桌面端即「手机取景框」宽度 */
  --header-h: 56px;
  --bezel: #06101f;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* 覆盖 ≥900px 的 66px 吸顶高度，保持手机比例 */
@media (min-width: 900px) {
  :root {
    --header-h: 56px;
  }
}

html {
  background: var(--bezel);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(circle at 50% -6%, rgba(200, 163, 90, 0.16), transparent 44%),
    linear-gradient(180deg, #0a1728 0%, #050c18 58%, #0a1728 100%);
  /* 给底部快捷条留出空间，避免压住页脚 */
  padding-bottom: calc(78px + var(--safe-bottom));
}

/* 顶部导航、主体、页脚统一收进竖栏 */
.site-header,
main,
.site-footer {
  width: 100%;
  max-width: var(--shell);
  margin-right: auto;
  margin-left: auto;
}

main {
  position: relative;
  background: linear-gradient(180deg, var(--paper), var(--paper-deep));
  box-shadow: 0 0 0 1px rgba(234, 214, 164, 0.14), 0 28px 80px rgba(0, 0, 0, 0.55);
}

.site-footer {
  /* 页面的浅色文字方案是为浅底设计的，必须给页脚一块实体浅底，
     否则半透明白会与深色机身混成灰色，正文对比度掉到 1.1:1 */
  margin-top: 0; /* 页脚直接贴着正文，避免 margin 露出深色机身底形成黑带 */
  background: var(--paper-deep);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.footer-col {
  gap: 2px;
}

.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 0;
}

/* 避免末行只剩两三个字（Safari 不支持时自动忽略） */
.footer-desc,
.section-header > p,
.page-hero-lead {
  text-wrap: pretty;
}

.footer-legal {
  color: var(--muted);
}

/* 跳转链接跟着竖栏居中；
   注意必须保留 translateY(-160%) 的隐藏位移，否则会常驻挡住 logo */
.skip-link {
  left: 50%;
  transform: translate(-50%, -160%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* ---------- 2. 导航：始终使用手机抽屉 ---------- */

.site-header-inner {
  gap: 10px;
  padding: 0 14px;
}

.site-brand img {
  width: 32px;
  height: 32px;
}

.site-brand-text {
  font-size: 14px;
}

/* 无脚本时的兜底：横向可滑动，仍然可用 */
.site-nav {
  gap: 2px;
  overflow-x: auto;
}

.site-nav a {
  padding: 8px 10px;
  font-size: 13px;
}

/* 有脚本时：桌面宽度也走抽屉，不再铺开 8 项横向导航 */
.js .nav-toggle {
  display: grid;
}

.js .site-nav {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  max-height: 70vh;
  max-height: calc(100dvh - var(--header-h));
  margin: 0;
  padding: 10px 14px calc(16px + var(--safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  border-bottom: 1px solid rgba(200, 163, 90, 0.24);
  background: rgba(6, 15, 28, 0.985);
  box-shadow: 0 26px 44px rgba(0, 0, 0, 0.42);
}

.js .site-nav.is-open {
  display: flex;
}

.js .site-nav a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 12px 10px;
  border-radius: 8px;
  font-size: 15px;
}

.js .site-nav .nav-cta {
  display: flex;
  justify-content: center;
  margin: 8px 0 0;
  padding: 13px 16px;
}

/* ---------- 3. 全部栅格回到单列 ---------- */

.service-grid,
.chain,
.support-grid,
.why-grid,
.fit-grid,
.module-grid,
.deliver-grid,
.channel-grid,
.process-list,
.dir-grid,
.footer-inner,
.cta-panel {
  grid-template-columns: 1fr;
}

.service-grid,
.fit-grid,
.module-grid,
.deliver-grid {
  gap: 14px;
}

.process-list {
  gap: 12px;
}

.channel-grid {
  gap: 18px;
}

.footer-inner {
  gap: 26px;
}

.cta-panel {
  gap: 22px;
}

.dir-grid {
  gap: 12px;
}

.support-grid,
.why-grid {
  gap: 0;
}

/* 五步链路必须留在「竖直时间轴」形态。
   styles.css 的 ≥1024px 断点会把它改成 5 列网格 + 每步一道满宽金色渐变条
   （::before 从 1px 竖线变成 2px 横线，最后一项还有 14px 高），
   而竖栏只有 420px 宽，于是五条金线层层压住文字。这里整套还原。 */
.chain {
  gap: 0;
}

.chain li::before {
  top: 5px;
  right: auto;
  bottom: 0;
  left: 0;
  width: 1px;
  height: auto;
  background: rgba(234, 214, 164, 0.34);
}

.chain li:last-child::before {
  bottom: auto;
  height: 14px;
}

.chain li::after {
  top: 5px;
  left: -2px;
  width: 5px;
  height: 5px;
}

.chain-no {
  margin-top: 0;
}

/* 产业方向：不再是横向滑动卡，直接沿用 styles.css 的自适应索引栅格
   （手机竖栏自动排成 2 列 × 5 行，一屏内看全 10 个方向） */
.industry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

/* ---------- 4. 排版与留白回到手机尺度 ---------- */

.section {
  padding: 52px 20px 0;
}

.section--last {
  padding-bottom: 56px;
}

.band .section {
  padding-top: 52px;
  padding-bottom: 52px;
}

.section-header {
  margin-bottom: 24px;
}

/* 标题字号的上限要跟着竖栏走，不能跟着视口走。
   基础样式写的是 clamp(22px, 5.6vw, 30px)：竖栏固定 420px 宽，
   vw 却按 1280px 视口算 → 一路顶到 30px，标题在 420px 里被迫断行，
   末行只剩「么」「赋能」这种一个字，很难看。上限压到 24px 后
   13 字标题正好一行，长标题交给 balance 均分两行。 */
.section-header h2,
.intro-title {
  font-size: clamp(22px, 5.6vw, 24px);
  text-wrap: balance;
}

.cta-panel h2 {
  font-size: clamp(20px, 5vw, 22px);
  text-wrap: balance;
}

/* 标题前的小图标跟着标题缩，否则比字还高，第一行被它挤短 */
.title-row svg {
  width: 20px;
  height: 20px;
  margin-top: 4px;
}

.section-header > p:not(.eyebrow) {
  font-size: 14px;
}

/* 竖栏一行只有 13～14 个字，末行掉出两三个字很扎眼；统一交给 pretty 收一下 */
main p {
  text-wrap: pretty;
}

/* 卡片里的短说明（2～3 行）再进一步：均分成等宽两行，
   避免出现「捆绑。」「弯路。」这种两个字独占一行 */
.support-card p,
.why-card p,
.module-card p,
.service-card p,
.fit-card p {
  text-wrap: balance;
}

.hero {
  /* 首屏正好一屏：文字下沉后上方山头完整露出，且不再露出下一屏的半截标题 */
  min-height: 560px;
  min-height: calc(100svh - var(--header-h));
}

.hero-inner {
  /* 留出底部悬浮条（67px）的位置，按钮不被压住 */
  padding: 48px 20px 96px;
}

.hero h1 {
  font-size: 28px;
}

.hero-lead {
  margin-top: 16px;
  font-size: 14px;
  text-wrap: pretty;
}

.hero-lead strong {
  font-size: 17px;
}

/* 首屏只留主张 + 一句实证 + 两个按钮，按钮与正文之间靠这一段留白撑开 */
.hero-actions {
  margin-top: 28px;
}

/* 第二屏（平台陈述）：竖栏里略微收窄上留白，正文顶格更整齐 */
.section--intro {
  padding-top: 46px;
}

.intro-lead {
  font-size: 14px;
  text-wrap: pretty;
}

.intro-note {
  text-wrap: pretty;
}

.service-card {
  padding: 22px 20px 20px;
}

.cta-panel {
  padding: 26px 22px;
}

.qr-card {
  justify-self: start;
}

/* 吸顶导航 + 二级导航共约 100px，锚点跳转要补偿，否则标题被压在导航下面 */
.section[id],
section[id] {
  scroll-margin-top: calc(var(--header-h) + 56px);
}

/* ---------- 5. 服务页模板回到手机版式 ---------- */

.page-hero-inner {
  padding: 26px 20px 36px;
}

.page-hero h1 {
  max-width: none;
  font-size: 27px;
}

.page-hero-lead {
  font-size: 14px;
}

.page-hero-facts {
  max-width: none;
  gap: 10px;
}

/* 首屏三个数字同样受 vw 上限影响（26px 会撑破 1/3 栏），按竖栏压到 19px */
.page-hero-facts strong {
  font-size: clamp(17px, 4.4vw, 19px);
}

.subnav-inner {
  padding: 0 14px;
}

.subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 12px 10px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* 放不下时（窄机 / 6 项导航）右侧渐隐，提示还能横向滑；
   脚本会给 .subnav 加 is-scrollable / is-end */
.subnav.is-scrollable .subnav-inner {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
}

.subnav.is-scrollable.is-end .subnav-inner {
  -webkit-mask-image: none;
  mask-image: none;
}

.channel-panel {
  padding: 24px 20px;
}

.tab {
  padding: 13px 12px;
}

/* ---------- 6. 机构检索库回到手机版式 ---------- */

.directory {
  padding: 22px 15px 24px;
}

.dir-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* 机构库标题 / 统计数字同样按竖栏收上限（桌面断点会顶到 26px） */
.dir-head h3 {
  font-size: clamp(18px, 4.8vw, 21px);
}

.dir-stats strong {
  font-size: clamp(17px, 4.4vw, 19px);
}

.dir-selects {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dir-filters {
  gap: 12px;
  padding: 14px;
}

/* 类型徽标从标题右侧移到标题上方，让长公司名独占一行，不再被挤断 */
.dir-name {
  /* 竖栏里 16px 时 20 字的长名只差 6px 就换行，压到 15.5px 后多数机构名一行放得下；
     仍超长的交给 pretty，避免末行只剩一两个字 */
  font-size: 15.5px;
  text-wrap: pretty;
}

.dir-card-top {
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 5px;
}

/* 机构卡片底部的「发起对接咨询」原本只有 17px 高，手机上很难点中 */
.dir-actions {
  gap: 2px 16px;
}

.dir-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
}

/* 机构卡片底部的「发起对接咨询」原本只有 17px 高，手机上很难点中 */
.dir-actions {
  gap: 2px 16px;
}

.dir-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
}

/* iOS 聚焦输入框会自动放大，字号必须 ≥16px */
.dir-search input,
.dir-field select {
  font-size: 16px;
}

/* ---------- 7. 对照表：窄栏里转成卡片，杜绝横向滚动 ---------- */

.matrix-wrap {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.matrix {
  display: block;
  width: 100%;
  min-width: 0;
}

.matrix thead {
  display: none;
}

.matrix tbody {
  display: block;
}

.matrix tbody tr {
  display: block;
  margin-bottom: 12px;
  padding: 4px 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.matrix tbody tr:nth-child(even) {
  background: var(--card);
}

.matrix tbody tr:last-child {
  margin-bottom: 0;
}

.matrix th,
.matrix td {
  display: block;
  padding: 9px 0;
  border: 0;
  text-align: left;
  white-space: normal;
}

.matrix tbody th {
  padding-top: 12px;
  padding-bottom: 4px;
  font-size: 15.5px;
}

.matrix tbody th::after {
  display: block;
  width: 26px;
  height: 2px;
  margin-top: 9px;
  border-radius: 2px;
  background: rgba(200, 163, 90, 0.75);
  content: "";
}

.matrix td[data-label]::before {
  display: block;
  margin-bottom: 3px;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  content: attr(data-label);
}

.matrix td + td {
  border-top: 1px dashed var(--line);
}

/* ---------- 8. 底部快捷操作条 ---------- */

.phone-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  border-top: 1px solid rgba(200, 163, 90, 0.28);
  background: rgba(14, 29, 50, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.phone-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.phone-bar-cta {
  flex: 1;
  background: var(--gold);
  color: #101c2e;
}

.phone-bar-cta:active {
  background: var(--gold-soft);
}

.phone-bar-top {
  flex: none;
  width: 46px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--white);
  font-size: 15px;
}

/* ---------- 9. 触控目标与焦点 ---------- */

.btn,
.dir-chip,
.dir-page {
  min-height: 44px;
}

.dir-search input,
.dir-field select {
  min-height: 44px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(200, 163, 90, 0.85);
  outline-offset: 2px;
}

/* ---------- 10. 横屏矮窗口：保留可读的紧凑版 ---------- */

@media (orientation: landscape) and (max-height: 540px) {
  .hero {
    min-height: 420px;
  }

  .hero h1 {
    font-size: 25px;
  }
}

/* 矮屏（小家电机型 / 浏览器工具栏占位多）：字号与留白同步收紧，
   保证文字仍落在山脚暗部，不压到雪线亮部 */
@media (max-height: 700px) {
  .hero h1 {
    font-size: 26px;
  }

  .hero-lead {
    margin-top: 14px;
    font-size: 13.5px;
  }

  .hero-actions {
    margin-top: 20px;
  }

  .hero-inner {
    padding: 40px 20px 84px;
  }
}
