/* ===== 基础 ===== */
html { scroll-behavior: smooth; }
body { background: #0a0a0a; color: #fff;
       font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
       overflow-x: hidden; }

/* ===== Logo ===== */
.logo-text { letter-spacing: .08em; font-size: 1.25rem; font-weight: 900; line-height: 1; }
.logo-api  { color: #f97316; }
.logo-ya   { color: #ffffff; }

/* ===== 顶部进度条 ===== */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, #f97316, #fbbf24);
  z-index: 100; transition: width .1s linear;
  box-shadow: 0 0 8px #f97316aa;
}

/* ===== 抽屉菜单 ===== */
#drawer { transform: translateX(110%); transition: transform .35s cubic-bezier(.4,0,.2,1); }
#drawer.open { transform: translateX(0); }
#drawer-overlay { opacity: 0; pointer-events: none; transition: opacity .35s ease; }
#drawer-overlay.open { opacity: 1; pointer-events: auto; }

/* 抽屉导航项逐一滑入 */
#drawer nav a { opacity: 0; transform: translateX(20px); transition: opacity .3s ease, transform .3s ease, background .2s; }
#drawer.open nav a:nth-child(1) { opacity:1; transform:none; transition-delay:.08s; }
#drawer.open nav a:nth-child(2) { opacity:1; transform:none; transition-delay:.14s; }
#drawer.open nav a:nth-child(3) { opacity:1; transform:none; transition-delay:.20s; }
#drawer.open nav a:nth-child(4) { opacity:1; transform:none; transition-delay:.26s; }
#drawer.open .drawer-cta { opacity:1; transform:none; }
.drawer-cta { opacity:0; transform:translateY(10px); transition: opacity .3s .32s ease, transform .3s .32s ease; }

/* 汉堡 → X 动画 */
#hamburger span { display:block; width:22px; height:2px; background:#999;
                  border-radius:2px; transition: transform .3s ease, opacity .3s ease, background .2s; }
#hamburger span:nth-child(2) { margin: 5px 0; }
#hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background:#f97316; }
#hamburger.active span:nth-child(2) { opacity:0; }
#hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background:#f97316; }

/* ===== 桌面导航下划线特效 ===== */
.nav-link { position: relative; padding-bottom: 2px; }
.nav-link::after {
  content:''; position:absolute; left:0; bottom:0; height:2px; width:0;
  background:#f97316; border-radius:2px;
  transition: width .25s ease;
}
.nav-link:hover::after, .nav-link.active::after { width:100%; }
.nav-link:hover, .nav-link.active { color:#fff !important; }

/* ===== 滚动动画 ===== */
.reveal { opacity:0; transform:translateY(28px); transition: opacity .55s ease, transform .55s ease; }
.reveal.visible { opacity:1; transform:none; }
.reveal-left  { opacity:0; transform:translateX(-32px); transition: opacity .55s ease, transform .55s ease; }
.reveal-left.visible  { opacity:1; transform:none; }
.reveal-right { opacity:0; transform:translateX(32px); transition: opacity .55s ease, transform .55s ease; }
.reveal-right.visible { opacity:1; transform:none; }

/* ===== Hero 入场动画 ===== */
@keyframes fadeInUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:none; } }
.hero-badge  { animation: fadeInUp .5s .1s both ease; }
.hero-title  { animation: fadeInUp .5s .22s both ease; }
.hero-sub    { animation: fadeInUp .5s .34s both ease; }
.hero-flow   { animation: fadeInUp .5s .46s both ease; }
.hero-cta    { animation: fadeInUp .5s .58s both ease; }

/* ===== 按钮脉冲 ===== */
@keyframes pulse-orange { 0%,100%{ box-shadow:0 0 0 0 rgba(249,115,22,.4); } 50%{ box-shadow:0 0 0 10px rgba(249,115,22,0); } }
.btn-pulse { animation: pulse-orange 2.5s infinite; }

/* ===== 步骤卡片 ===== */
.step-card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.step-card:hover { transform:translateY(-4px); box-shadow:0 12px 40px rgba(249,115,22,.15); border-color:#f97316 !important; }

/* ===== 图片懒加载淡入 ===== */
.lazy-img { opacity:0; transition:opacity .5s ease; }
.lazy-img.loaded { opacity:1; }

/* ===== 视频容器 ===== */
.video-wrap { position:relative; padding-top:56.25%; background:#141414; border-radius:16px; overflow:hidden; }
.video-wrap video { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }

/* ===== FAQ 折叠 ===== */
.faq-body { max-height:0; overflow:hidden; transition:max-height .4s cubic-bezier(.4,0,.2,1); }
.faq-body.open { max-height:300px; }
.faq-btn { transition: background .2s; }
.faq-btn:hover { background:#1a1a1a; }

/* ===== 准备卡片 stagger ===== */
.prep-card { opacity:0; transform:translateY(20px);
             transition: opacity .5s ease, transform .5s ease, box-shadow .2s, border-color .2s; }
.prep-card.visible { opacity:1; transform:none; }
.prep-card:hover { box-shadow:0 6px 24px rgba(249,115,22,.1); border-color:#f97316 !important; }
.prep-card:nth-child(1) { transition-delay:.0s; }
.prep-card:nth-child(2) { transition-delay:.1s; }
.prep-card:nth-child(3) { transition-delay:.2s; }

/* ===== 返回顶部 ===== */
#back-top { transition: opacity .3s ease, transform .3s ease, background .2s; }
#back-top.hidden-btn { opacity:0; pointer-events:none; transform:translateY(10px); }
#back-top:hover { transform:translateY(-2px) !important; }

/* ===== APiYA.Ai 品牌文字 ===== */
.brand-api { color:#f97316; }
.brand-ya  { color:#ffffff; }

/* ===== 橙色 glow 数字 ===== */
.step-num { color:#f97316; text-shadow: 0 0 20px rgba(249,115,22,.4); }

/* ===== 图片点击提示 ===== */
.img-clickable { cursor: zoom-in; position: relative; overflow: hidden; }

/* ===== Lightbox ===== */
#lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.97);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
#lightbox.open { opacity: 1; pointer-events: auto; }

/* 顶部信息栏 */
#lb-header {
  flex-shrink: 0;
  padding: 28px 72px 20px;
  text-align: center;
  transform: translateY(-16px);
  transition: transform .32s ease, opacity .32s ease;
  opacity: 0;
}
#lightbox.open #lb-header { transform: translateY(0); opacity: 1; transition-delay: .08s; }
#lb-step-num {
  font-size: .75rem; letter-spacing: .18em; color: #f97316;
  font-weight: 700; text-transform: uppercase; margin-bottom: 8px;
}
#lb-title {
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 800; color: #fff; margin-bottom: 8px; line-height: 1.3;
}
#lb-desc {
  font-size: .875rem; color: #888; line-height: 1.6;
  max-width: 560px; margin: 0 auto;
}

/* 图片区 — 桌面有左右箭头，两侧留 80px */
#lb-img-wrap {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 80px 28px;
  position: relative;
}
#lb-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 10px;
  transition: opacity .22s ease, transform .22s ease;
  display: block;
}
#lb-img.out-left  { opacity:0; transform:translateX(-60px); }
#lb-img.out-right { opacity:0; transform:translateX(60px); }

/* 浮动箭头 — 仅桌面显示 */
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 64px; cursor: pointer;
  background: none; border: none; padding: 0;
  z-index: 9001;
  transition: opacity .2s;
}
.lb-nav:disabled { opacity: .18; cursor: default; }
.lb-nav svg { transition: transform .2s ease, filter .2s ease; }
.lb-nav:not(:disabled):hover svg {
  transform: scale(1.15);
  filter: drop-shadow(0 0 14px rgba(249,115,22,.9));
}
#lb-prev { left: 0; }
#lb-next { right: 0; }

/* 手机隐藏浮动箭头，图片区无侧边距 */
@media (max-width: 639px) {
  .lb-nav { display: none; }
  #lb-img-wrap {
    flex: 0 1 auto;       /* 不撑满剩余空间，随图片高度自适应 */
    padding: 0 12px 0;
  }
  #lb-header { padding: 20px 48px 14px; }
  #lb-title { font-size: 1.1rem; }
  #lb-desc  { font-size: .8rem; }
}

/* 关闭按钮 */
#lb-close {
  position: fixed; top: 18px; right: 22px;
  width: 38px; height: 38px; border-radius: 50%;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 9002;
  transition: background .2s, border-color .2s, transform .2s;
}
#lb-close:hover { background: #f97316; border-color: #f97316; transform: scale(1.1) rotate(90deg); }

/* 底部圆点 — 桌面显示 */
#lb-dots {
  flex-shrink: 0; display: flex; justify-content: center;
  gap: 7px; padding-bottom: 20px;
}
.lb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #333; cursor: pointer;
  transition: background .2s, transform .2s;
}
.lb-dot.active { background: #f97316; transform: scale(1.5); }
@media (max-width: 639px) { #lb-dots { display: none; } }

/* 手机底部导航栏 */
#lb-mobile-bar {
  display: none;
  flex-shrink: 0;
  align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 16px;
  margin-top: 10px;
}
@media (max-width: 639px) { #lb-mobile-bar { display: flex; } }

.lb-mob-btn {
  display: flex; align-items: center; gap: 8px;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  color: #bbb; font-size: .85rem; font-weight: 600;
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
  white-space: nowrap;
}
.lb-mob-btn:not(:disabled):active { transform: scale(.95); }
.lb-mob-btn:not(:disabled):hover  { background: #f97316; border-color: #f97316; color: #fff; }
.lb-mob-btn:disabled { opacity: .25; cursor: default; }

#lb-mob-counter {
  font-size: .8rem; color: #555; font-weight: 700;
  letter-spacing: .08em; flex-shrink: 0;
}
