/* PicH 首页单屏（index.html → css/home.css） */
/* Sora 700：自托管 woff2（SIL OFL，来源 fonts.google.com） */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/sora-700-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/sora-700-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html:has(body.pich-home),
html:has(body.pich-home) body {
  height: 100%;
  max-height: 100%;
}

body.pich-home {
  margin: 0;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  color-scheme: dark;
  font-family:
    "SF Pro Display",
    "SF Pro Text",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: #fff;
  background: #030712;
  -webkit-font-smoothing: antialiased;
}

.pich-view {
  --pich-edge: clamp(40px, 8vw, 140px);
  position: relative;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.pich-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("https://img.btoai.com/banner.png") center / cover no-repeat;
  transform: scale(1.02);
  transform-origin: center center;
}

/* 流动柔光（Canvas）：须在蒙版之上，否则暗蒙版会把光吃没 */
.pich-aurora {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* screen：在压暗后的画面上仍能看出青紫流动 */
  mix-blend-mode: screen;
  opacity: 0.52;
}

.pich-aurora canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .pich-aurora {
    opacity: 0.48;
  }
}

/* 大块左上氛围蒙版：多层叠压，右下仍透照片 */
.pich-mask-tl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(
      ellipse 145% 125% at 0% 0%,
      rgba(2, 6, 18, 0.94) 0%,
      rgba(2, 6, 18, 0.82) 28%,
      rgba(2, 6, 18, 0.62) 52%,
      rgba(2, 6, 18, 0.3) 72%,
      transparent 90%
    ),
    radial-gradient(ellipse 90% 85% at -8% 35%, rgba(4, 10, 28, 0.58) 0%, transparent 58%),
    linear-gradient(128deg, rgba(3, 8, 22, 0.78) 0%, rgba(3, 8, 22, 0.34) 46%, transparent 70%);
}

.pich-hero {
  position: absolute;
  z-index: 3;
  top: clamp(1em, 15vh, 200px);
  left: var(--pich-edge);
  max-width: min(92vw, 720px);
}

.pich-logo {
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(12px, 2.2vw, 24px);
  /* 字号挂在容器上，logo 用 em 与字高锁定比例，避免和标题错位 */
  font-size: clamp(4.6rem, 18.5vw, 10rem);
  line-height: 0.92;
}

.pich-logo__mark {
  flex-shrink: 0;
  width: auto;
  height: 0.88em;
  object-fit: contain;
  display: block;
  transform: translateY(0.02em);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
}

/* 字标：Sora 700（woff2 在 ../fonts/，见文件头 @font-face） */
.pich-logo__text {
  font-family:
    "Sora",
    "SF Pro Display",
    "SF Pro Text",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-transform: none;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.45),
    0 20px 80px rgba(0, 0, 0, 0.4);
}

.pich-slogan {
  margin: clamp(2em, 4.8vh, 2em) 0 0;
  max-width: 22em;
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.72;
  color: rgba(248, 250, 252, 0.88);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.5);
}

/* 第二行：打字机占位与光标（与最长文案同宽，避免换行跳动） */
.pich-slogan__line2 {
  display: block;
  margin-top: 0.35em;
}

.pich-slogan__tw-slot {
  display: inline-grid;
  vertical-align: baseline;
  margin-left: 0.04em;
}

.pich-slogan__tw-measure,
.pich-slogan__tw-text {
  grid-area: 1 / 1;
  white-space: nowrap;
  /* 与整句 slogan 同系比例，略放大、加粗作强调；measure 同步避免占位错位 */
  font-size: clamp(1.18rem, 3vw, 1.62rem);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.pich-slogan__tw-measure {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.pich-slogan__tw-text {
  justify-self: start;
  align-self: start;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 0 28px rgba(147, 197, 253, 0.22),
    0 2px 22px rgba(0, 0, 0, 0.5);
}

/* 光标紧跟已打出文字（不再固定在 slot 右缘） */
.pich-slogan__tw-text::after {
  content: "";
  display: inline-block;
  width: 0.06em;
  min-width: 2px;
  height: 1.05em;
  margin-left: 0.06em;
  vertical-align: -0.12em;
  border-radius: 1px;
  background: #12f3f9;
  animation: pich-tw-blink 1s step-end infinite;
}

@keyframes pich-tw-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pich-slogan__tw-text::after {
    animation: none;
    opacity: 0.75;
  }
}

/* 移动端：slogan 下提示（桌面隐藏） */
.pich-pc-hint {
  display: none;
  margin: 0;
  padding: 0;
  max-width: 22em;
  font-size: clamp(0.78rem, 2.2vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.52);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

@media (max-width: 900px),
  ((max-height: 520px) and (max-width: 932px) and (orientation: landscape)) {
  .pich-pc-hint {
    display: block;
    margin: clamp(8px, 1.2vh, 16px) 0 0;
  }
}

/* 右下角：说明文案 + 玻璃入口组（整体略向左收） */
.pich-entries-stack {
  position: absolute;
  z-index: 3;
  right: clamp(52px, 8vw, 112px);
  bottom: clamp(108px, 20vh, 200px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.pich-entries-eyebrow {
  margin: 0;
  padding: 0 0 20px;
  max-width: min(92vw, 720px);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.52);
  text-align: left;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

/* 右下角大卡片：宽屏 3+1；≤900px 在下方改为 2×2，避免第四张单独挂一角 */
.pich-entries {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: start;
  gap: 14px;
  width: min(280px, 86vw);
}

@media (min-width: 720px) {
  .pich-entries {
    grid-template-columns: repeat(3, max-content);
    width: auto;
    max-width: min(92vw, calc(100vw - clamp(52px, 8vw, 112px) - 24px));
  }
}

/* 仅 4 张、宽屏 3 列时：第 4 张占第二行第 1 列（下方 ≤900px 的 2×2 会覆盖 grid-column） */
.pich-entries > .pich-entry:nth-child(4):last-child {
  grid-column: 1;
  justify-self: stretch;
}

/* 720–900：小平板竖屏等，与窄屏一致用 2×2 */
@media (min-width: 720px) and (max-width: 900px) {
  .pich-entries {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: min(
      320px,
      calc(100vw - clamp(52px, 8vw, 112px) - clamp(18px, 5vw, 40px))
    );
  }

  .pich-entries > .pich-entry:nth-child(4):last-child {
    grid-column: auto;
  }
}

.pich-entry {
  position: relative;
  display: block;
  min-width: 0;
  border-radius: 22px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.96);
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.pich-entry__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    120% 80% at 10% 0%,
    rgba(255, 255, 255, 0.22) 0%,
    transparent 55%
  );
  pointer-events: none;
  z-index: 0;
}

.pich-entry__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 20px 18px 20px 22px;
  border-radius: inherit;
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.08) 38%,
    rgba(255, 255, 255, 0.04) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(42px) saturate(200%);
  -webkit-backdrop-filter: blur(42px) saturate(200%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.12) inset,
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -24px 48px -28px rgba(255, 255, 255, 0.06) inset,
    0 40px 80px -24px rgba(0, 0, 0, 0.55),
    0 12px 32px rgba(0, 0, 0, 0.35);
}

.pich-entry__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
}

.pich-entry__icon svg {
  display: block;
  width: 28px;
  height: 28px;
}

.pich-entry__icon--pip svg {
  width: 32px;
  height: 32px;
  transform: translateY(-4px);
}

.pich-entry__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pich-entry__title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.pich-entry__sub {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.pich-entry:hover {
  transform: translateY(-4px);
}

.pich-entry:hover .pich-entry__sheen {
  opacity: 1;
}

.pich-entry:hover .pich-entry__inner {
  border-color: rgba(255, 255, 255, 0.52);
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.12) 42%,
    rgba(255, 255, 255, 0.06) 100%
  );
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.1) inset,
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 -24px 48px -28px rgba(255, 255, 255, 0.08) inset,
    0 48px 100px -28px rgba(0, 0, 0, 0.6),
    0 0 60px -10px rgba(96, 165, 250, 0.22);
}

.pich-entry:focus-visible {
  outline: none;
}

.pich-entry:focus-visible .pich-entry__inner {
  outline: 2px solid rgba(147, 197, 253, 0.95);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .pich-entry {
    transition: none;
  }

  .pich-entry:hover {
    transform: none;
  }
}

/* 手机：四入口 2×2、收窄卡片与底距，避免与底栏挤爆 */
@media (max-width: 719px) {
  .pich-hero {
    top: clamp(2em, 11vh, 2em);
  }

  .pich-logo {
    font-size: clamp(4.6rem, 23vw, 8rem);
    gap: clamp(14px, 2.8vw, 22px);
  }

  .pich-entries-stack {
    right: clamp(32px, 5vw, 64px);
    bottom: clamp(72px, 11vh, 120px);
    gap: 4px;
  }

  .pich-entries-eyebrow {
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 0 0 3px;
    max-width: min(86vw, 360px);
  }

  .pich-entries {
    /* 四入口：2×2 比 3+1 更稳；宽度须扣除右侧定位与左侧留白，避免挤出视口 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: min(
      320px,
      calc(100vw - clamp(32px, 5vw, 64px) - clamp(18px, 5vw, 36px))
    );
    gap: 6px;
  }

  .pich-entries > .pich-entry:nth-child(4):last-child {
    grid-column: auto;
  }

  .pich-entry {
    border-radius: 16px;
  }

  .pich-entry__inner {
    min-height: 56px;
    padding: 9px 10px 9px 12px;
    gap: 9px;
    border-radius: 16px;
  }

  .pich-entry__title {
    font-size: 14px;
  }

  .pich-entry__sub {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .pich-entry__icon svg {
    width: 22px;
    height: 22px;
  }

  .pich-entry__icon--pip svg {
    width: 26px;
    height: 26px;
    transform: translateY(-2px);
  }
}

/* 横持 / 旋转后可视高度较矮：再压一档 */
@media (max-height: 460px) and (max-width: 960px) {
  .pich-entries-stack {
    bottom: clamp(46px, 7.5vh, 88px);
    gap: 3px;
  }

  .pich-entries-eyebrow {
    font-size: 9px;
    padding: 0 0 2px;
    letter-spacing: 0.06em;
  }

  .pich-entries {
    gap: 5px;
  }

  .pich-entry__inner {
    min-height: 48px;
    padding: 6px 8px 6px 10px;
    gap: 7px;
  }

  .pich-entry__title {
    font-size: 13px;
  }

  .pich-entry__sub {
    font-size: 9px;
  }

  .pich-entry__icon svg {
    width: 20px;
    height: 20px;
  }

  .pich-entry__icon--pip svg {
    width: 24px;
    height: 24px;
  }
}

/* 最底部外链推荐条 */
.pich-reco {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(18px, 3.5vw, 36px) max(14px, env(safe-area-inset-bottom, 14px))
    max(var(--pich-edge), env(safe-area-inset-left, 0px));
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x pinch-zoom;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-size: 100% 100%;
}

.pich-reco::-webkit-scrollbar {
  display: none;
}

.pich-glass--reco {
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.pich-glass--reco:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.pich-glass--reco:focus-visible {
  outline: 2px solid rgba(147, 197, 253, 0.95);
  outline-offset: 2px;
}

/* 底部推荐条：小屏药丸略小 */
@media (max-width: 719px),
  ((max-height: 500px) and (max-width: 932px) and (orientation: landscape)) {
  .pich-reco {
    padding: 7px clamp(12px, 3vw, 24px) max(10px, env(safe-area-inset-bottom, 10px))
      max(var(--pich-edge), env(safe-area-inset-left, 0px));
    gap: 6px;
    mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
  }

  .pich-glass--reco {
    padding: 5px 11px;
    font-size: 11px;
  }
}

/* 极矮屏：在上一段基础上再缩推荐条（须写在上段之后以覆盖） */
@media (max-height: 460px) and (max-width: 960px) {
  .pich-reco {
    gap: 4px;
    padding-top: 5px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
  }

  .pich-glass--reco {
    padding: 4px 9px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pich-bg {
    transform: none;
  }

  .pich-glass--reco {
    transition: none;
  }

  .pich-glass--reco:hover {
    transform: none;
  }
}

/* 竖屏触摸 + 窄屏：由 js/home-rot.js 加 .pich-mobile-rot，仅 .pich-view 做 frame 同款 transform */
html:has(body.pich-mobile-rot) {
  overflow: hidden;
  height: 100%;
}

body.pich-home.pich-mobile-rot {
  display: block;
  overflow: hidden;
  min-height: 0;
  height: auto;
  max-height: none;
  /* 避免 body 高度塌成 0（子级为 fixed 时） */
  min-height: 100vh;
  min-height: 100dvh;
}

body.pich-home.pich-mobile-rot .pich-view {
  position: fixed;
  top: 0;
  left: 0;
  transform-origin: top left;
  max-width: none;
  max-height: none;
}
