/* ============================================================================
   MaxMind · Apple 式全屏移动菜单（≤720px）
   ----------------------------------------------------------------------------
   规则：
   1. 只新增 am-* 类，不改 style.css / theme.css / apple.css 的任何既有规则。
   2. 手机端隐藏旧的 .main-nav 平铺菜单，桌面端隐藏 .am，互不干扰。
   3. 视觉全部由 CSS 绘制（零位图、零外链），CSP default-src 'self' 下可用。
   4. 无图标：一级只有文字（模型 / 价格 / 开放平台），底部保留登录、注册。
   5. 点「模型」→ 一级层向左滑出渐隐，二级层自右滑入渐显（Apple 手感）。
   ========================================================================== */

/* ---------- 深浅色切换按钮：已按要求下线（页面被改回旧版也照样隐藏） ---------- */
#themeBtn,
.theme-btn {
  display: none !important;
}

/* ---------- 旧菜单让位（只作用于手机） ---------- */
@media (max-width: 720px) {
  .main-nav {
    display: none !important;
  }
}

@media (min-width: 721px) {
  .am {
    display: none !important;
  }
}

/* ---------- 遮罩层 ---------- */
.am {
  /* 令牌：跟随站点深浅主题（--bg 深色 #0A0B0D / 浅色 #FFFFFF） */
  --am-bg: var(--bg, #0A0B0D);
  --am-fg: var(--text, #FFFFFF);
  --am-line: var(--line-strong, rgba(127, 127, 127, .32));
  --am-tap: rgba(127, 127, 127, .16);
  --am-bar: 60px;
  --am-safe-top: env(safe-area-inset-top, 0px);
  --am-safe-bot: env(safe-area-inset-bottom, 0px);

  /* 苹果常用的减速曲线，比 ease 更"沉" */
  --am-ease: cubic-bezier(.32, .72, 0, 1);
  --am-ease-out: cubic-bezier(.16, 1, .3, 1);

  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  /* body 是 text-align:center（整站居中排版），这里必须显式左对齐 */
  text-align: left;
  background: var(--am-bg);
  color: var(--am-fg);
  height: 100vh;
  height: 100dvh;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
  /* 底色快速就位（.18s），避免中间帧里页面从半透明白底下透出来；
     文字的逐条渐显交给下面 .am-item 自己的节奏 */
  transition:
    opacity .18s var(--am-ease),
    visibility .18s linear;
}

.am.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---------- 顶部工具条：返回 / 关闭 ---------- */
.am-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--am-bar) + var(--am-safe-top));
  padding: var(--am-safe-top) 12px 0;
  pointer-events: none;
}

.am-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--am-fg);
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transform: scale(.94);
  transition:
    opacity .28s var(--am-ease),
    transform .28s var(--am-ease),
    background-color .18s linear;
}

.am-ico svg {
  display: block;
  width: 20px;
  height: 20px;
}

.am-ico:active {
  background: var(--am-tap);
}

.am.is-open .am-ico {
  opacity: 1;
  transform: none;
  transition-delay: .07s;
}

/* 返回箭头只在二级层出现 */
.am-back {
  visibility: hidden;
  opacity: 0;
  transform: translateX(-6px);
}

.am[data-level="sub"] .am-back {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

/* ---------- 视图容器：两层水平叠放 ---------- */
.am-view {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--am-bar) + var(--am-safe-top));
  bottom: 0;
  overflow: hidden;
  /* 整块内容同上：打开时从上方落位 */
  transform: translateY(-10px);
  transition: transform .52s var(--am-ease-out);
}

.am.is-open .am-view {
  transform: none;
}

.am-pane {
  position: absolute;
  inset: 0;
  padding: 4px 20px calc(var(--am-safe-bot) + 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* 一级：静止居中，二级层打开时向左退出并渐隐 */
.am-pane--root {
  transform: translateX(0);
  opacity: 1;
  transition:
    transform .46s var(--am-ease),
    opacity .28s var(--am-ease);
}

.am[data-level="sub"] .am-pane--root {
  transform: translateX(-18%);
  opacity: 0;
  pointer-events: none;
}

/* 二级：默认停在右侧屏幕外，打开时划入并渐显 */
.am-pane--sub {
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition:
    transform .46s var(--am-ease),
    opacity .3s var(--am-ease),
    visibility .46s linear;
}

.am[data-level="sub"] .am-pane--sub {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

/* ---------- 一级条目 ---------- */
.am-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.am-item {
  display: block;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--am-fg);
  font-family: inherit;
  font-size: clamp(28px, 8.4vw, 38px);
  font-weight: 600;
  letter-spacing: -.026em;
  line-height: 1.14;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .18s linear;
}

.am-item:active {
  opacity: .55;
}

/* ---------- 二级层：标题 + 模型列表 ---------- */
.am-title {
  margin: 2px 0 14px;
  color: var(--am-fg);
  font-size: clamp(28px, 8.4vw, 38px);
  font-weight: 600;
  letter-spacing: -.026em;
  line-height: 1.14;
}

.am-sub {
  display: block;
  padding: 8px 0;
  color: var(--am-fg);
  font-size: clamp(28px, 8.4vw, 38px);
  font-weight: 400;
  letter-spacing: -.026em;
  line-height: 1.14;
  text-decoration: none;
  transition: opacity .18s linear;
}

.am-sub:active {
  opacity: .55;
}

/* ---------- 底部：登录 / 注册 ---------- */
.am-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 34px;
}

.am-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 12px 26px;
  border-radius: var(--radius-pill, 999px);
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.1;
  text-decoration: none;
  transition:
    transform .18s var(--am-ease),
    background-color .2s linear,
    color .2s linear,
    box-shadow .2s linear;
}

.am-btn:active {
  transform: scale(.97);
}

.am-btn--ghost {
  color: var(--am-fg);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--am-line);
}

/* 注册：反色实心胶囊（深色主题下白底黑字，浅色主题下黑底白字） */
.am-btn--fill {
  color: var(--am-bg);
  background: var(--am-fg);
  box-shadow: none;
}

/* ---------- 无动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .am,
  .am * {
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
}

/* ============================================================================
   入场动画 · 自上而下逐条渐显
   ----------------------------------------------------------------------------
   必须放在文件最后：.am-btn / .am-item / .am-sub 各自的 transition 简写会重置
   动画属性，写在前面的规则会被它们覆盖掉（登录/注册曾经因此直接闪出来）。
   这里把要动的属性一次性列全，阶梯序号用 --i，只给"打开"加延迟。
   ========================================================================== */
.am-item,
.am-title,
.am-sub,
.am-actions {
  opacity: 0;
  transform: translateY(-18px);
  will-change: opacity, transform;
  transition:
    opacity .55s var(--am-ease-out),
    transform .55s var(--am-ease-out),
    color .2s linear;
}

/* 一级：模型 → 价格 → 开放平台 → 登录、注册，一条接一条从上往下落 */
.am.is-open .am-item,
.am.is-open .am-actions {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 70ms + 90ms);
}

/* 二级：标题先到，三个模型跟着自上而下 */
.am[data-level="sub"] .am-pane--sub .am-title,
.am[data-level="sub"] .am-pane--sub .am-sub {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 70ms + 150ms);
}

/* 阶梯序号 */
.am-pane--root .am-list > li:nth-child(1) { --i: 0; }
.am-pane--root .am-list > li:nth-child(2) { --i: 1; }
.am-pane--root .am-list > li:nth-child(3) { --i: 2; }
.am-pane--root .am-list > li:nth-child(4) { --i: 3; }
.am-pane--root .am-actions { --i: 3; }

.am-pane--sub .am-title { --i: 0; }
.am-pane--sub .am-list > li:nth-child(1) { --i: 1; }
.am-pane--sub .am-list > li:nth-child(2) { --i: 2; }
.am-pane--sub .am-list > li:nth-child(3) { --i: 3; }
.am-pane--sub .am-list > li:nth-child(4) { --i: 4; }

/* ============================================================================
   2026-11-23 · 全站视觉收紧
   ① 禁止蓝紫渐变：渐变文字、渐变胶囊一律改中性纯色
   ② 去掉无意义的重阴影：卡片/按钮/浮层只保留 1px 细边，不再用大范围投影
   规则放在这里是因为本文件由 nginx 注入到每个 HTML 页面，页面源码怎么改都生效。
   ========================================================================== */

/* ---------- ① 渐变文字 → 纯色 ---------- */
.grad,
.fam-kicker.grad,
.tile-eyebrow.grad,
.tile-eyebrow .grad,
h1.grad,
h2.grad,
p.grad,
span.grad {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
  color: var(--text-2, #6B7280) !important;
}

/* ---------- ① 渐变胶囊（快速主力 / Plus 起 …）→ 中性描边 ---------- */
.tile-flag {
  background: none !important;
  background-image: none !important;
  color: var(--t-ink, currentColor) !important;
  -webkit-text-fill-color: currentColor !important;
  border: 1px solid var(--t-line, rgba(127, 127, 127, .35));
  box-shadow: none !important;
}

/* ---------- ② 重阴影收敛 ----------
   只去掉"往外抛"的大范围投影；按钮/面板靠 inset 描边撑出来的细边必须保留，
   否则描边按钮（开放平台、在线对话）会变成没有边框的裸文字。 */
.card,
.card--promo,
.card:hover,
.card--promo:hover,
.active-slide,
.p-plan,
.nav-model-sub,
.shot,
.peek-image {
  box-shadow: none !important;
}

/* 演示卡片：只去掉外层大投影，保留顶部 1px 高光 */
.demo-clip {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04) !important;
}

/* 描边按钮的细边来自 box-shadow inset，这里显式补回 */
.btn-ghost {
  box-shadow: inset 0 0 0 1.5px var(--line-strong, #D2D6DC) !important;
}
.btn-ghost:hover {
  box-shadow: inset 0 0 0 1.5px var(--text, #0E1116) !important;
}
.tbtn--line {
  box-shadow: inset 0 0 0 1.5px var(--t-line, rgba(127, 127, 127, .3)) !important;
}
