/* 大导航 —— 1:1 对应设计稿 Astra 6月 / Top 页
   数值全部取自 Figma：Products 1162:1351 / Solutions 1162:1494 / Systems 1162:2478 */

.amm {
  /* 设计令牌 */
  --amm-accent: #e60012;         /* color/brand/primary */
  --amm-bg-subtle: #f9f9f9;      /* color/bg/subtle */
  --amm-bg-default: #ffffff;     /* color/bg/default */
  --amm-surface: #ffffff;        /* color/surface/default */
  --amm-surface-cool: #f4f6f7;   /* color/surface/cool */
  --amm-border: #e5e5e5;         /* color/border/default */
  --amm-border-control: #dedfe0; /* color/border/control */
  --amm-text-strong: #000000;    /* color/text/strong */
  --amm-text-primary: #333333;   /* color/text/primary */
  --amm-text-inverse: #ffffff;   /* color/text/inverse */

  --amm-pad-x: 160px;
  --amm-col: 400px;

  position: static;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

/* 汉堡、遮罩、展开按钮只在抽屉里出场，桌面端完全不参与布局
   （桌面靠悬停展开，不需要独立的展开热区） */
.amm__burger,
.amm__scrim,
.amm__toggle {
  display: none;
}

/* ---------------- 一级菜单 */

.amm__top {
  display: flex;
  align-items: center;
  gap: 36px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.amm__top-item {
  position: static;
  display: flex;
  align-items: center;
}

.amm__top-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.16px;
  color: var(--amm-text-strong);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.amm__top-item.is-open > .amm__top-link,
.amm__top-link:hover,
.amm__top-link:focus-visible {
  color: var(--amm-accent);
}

.amm__chevron {
  flex: none;
  transition: transform 0.18s ease;
}

.amm__top-item.is-open .amm__chevron {
  transform: rotate(180deg);
}

/* ---------------- 面板外壳 */

/* 面板要通栏、并贴在整个页头下沿。
   如果用 absolute，定位基准是最近的定位祖先 —— Elementor 里那是包菜单的 widget 容器，
   只有 ul 那么宽（约栏宽）、那么高（20px），会导致面板既窄又盖住页头。
   所以改用 fixed，top / width 由 JS 按 <header> 的实际位置写入。 */
/* 设计稿里页头和面板之间那条分隔线属于页头（TOP 帧的 border-bottom），
   面板不带边框 —— 否则页头一旦配上边框就成了双线。 */
.amm__panel {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  z-index: 999;
  background: var(--amm-bg-subtle);
}

/* 菜单项底边到面板顶边之间是块死区，鼠标移过去会先触发 mouseleave 把面板关掉。
   这里向上补一条透明的“桥”把死区盖住 —— 它是面板的子元素，所以指针停在上面时
   菜单项的 mouseleave 不会触发。高度由 JS 按实际间距写入。 */
.amm__panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--amm-bridge, 0px));
  height: var(--amm-bridge, 0px);
}

.amm__panel[hidden] {
  display: none;
}

.amm__panel-body {
  display: flex;
  align-items: center;
  padding-left: var(--amm-pad-x);
}

/* 各面板高度按设计稿：Products 484 / Solutions 620 / Systems 716
   Systems 用固定高度而非 min-height —— 卡片区要在里面竖向滚动，需要一个确定的高度 */
.amm__panel--columns .amm__panel-body { min-height: 484px; }
.amm__panel--detail  .amm__panel-body { min-height: 620px; }
.amm__panel--tabs    .amm__panel-body { height: 716px; }

/* ---------------- 左栏（三种面板共用） */

.amm__col {
  display: flex;
  flex: none;
  flex-direction: column;
  align-self: stretch;
  justify-content: space-between;
  width: var(--amm-col);
  padding: 10px 0 20px;
}

.amm__list,
.amm__sublist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.amm__item {
  display: flex;
  width: 100%;
  border-left: 1px solid transparent;
}

.amm__item-link {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 20px;
  text-decoration: none;
}

.amm__item-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.16px;
  color: var(--amm-text-strong);
}

.amm__arrow {
  flex: none;
  color: var(--amm-border-control);
  transition: color 0.18s ease;
}

.amm__item.is-active {
  background: var(--amm-surface);
  border-left-color: var(--amm-accent);
}

.amm__item.is-active .amm__arrow,
.amm__item:hover .amm__arrow {
  color: var(--amm-accent);
}

.amm__viewall {
  display: flex;
  align-items: center;
  height: 20px;
  padding: 0 20px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  color: var(--amm-accent);
  text-decoration: none;
  white-space: nowrap;
}

/* ---------------- 右侧白底区 */

.amm__main {
  display: flex;
  align-items: center;
  flex: 1;
  align-self: stretch;
  min-width: 0;
  padding-right: var(--amm-pad-x);
  background: var(--amm-bg-default);
}

/* ---------------- Products：二级分类栏 + 指示条 */

.amm__subwrap {
  display: flex;
  flex: none;
  align-self: stretch;
  padding: 20px 0;
}

.amm__sub {
  display: none;
  flex-direction: column;
  gap: 10px;
  width: var(--amm-col);
  padding: 10px 20px;
}

.amm__sub.is-active {
  display: flex;
}

.amm__subitem {
  display: flex;
  width: 100%;
  border-bottom: 1px solid var(--amm-surface-cool);
}

.amm__subitem .amm__item-link {
  padding: 12px 0;
}

.amm__subitem .amm__arrow {
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease;
}

.amm__subitem.is-active {
  background: var(--amm-surface);
}

.amm__subitem.is-active .amm__arrow,
.amm__subitem:hover .amm__arrow {
  opacity: 1;
  color: var(--amm-accent);
}

/* 4px 竖条：灰色轨道 + 跟随选中项的红色滑块 */
.amm__indicator {
  position: relative;
  flex: none;
  align-self: stretch;
  width: 4px;
  background: #d9d9d9;
}

.amm__indicator-thumb {
  position: absolute;
  left: 0;
  width: 100%;
  background: var(--amm-accent);
  transition: top 0.22s ease, height 0.22s ease;
}

/* ---------------- Products：产品网格 */

.amm__grids {
  flex: 1;
  align-self: stretch;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
}

.amm__grid-pane {
  display: none;
  height: 100%;
}

.amm__grid-pane.is-active {
  display: block;
}

.amm__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.amm__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 不能用 space-between：卡片被拉到等高后，多出的空间会塞在图和标题之间，
     把标题顶到卡片底部 —— 于是单行标题比同排的两行标题低一整行（实测 36 vs 12）。
     统一从上往下排，标题始终贴在图下方 12px，各卡首行就对齐了。 */
  justify-content: flex-start;
  gap: 12px;
  min-height: 260px; /* 设计稿高度，内容更长时允许撑开 */
  text-decoration: none;
}

.amm__card-media {
  display: block;
  width: 100%;
  /* 原来写死 202px：卡片一变窄，图就被拉成竖条。
     改成按设计稿 239×202 的比例跟着宽度走，任何断点都不会变形 */
  aspect-ratio: 239 / 202;
  background: var(--amm-bg-subtle);
  overflow: hidden;
}

.amm__card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.amm__card-title {
  display: block;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--amm-text-strong);
  text-align: center;
  /* 型号是 EHI-4~6K-SL1Phase 这种不含空格的长串，默认断不开会顶出卡片 */
  overflow-wrap: anywhere;
  transition: color 0.18s ease;
}

.amm__card:hover .amm__card-title {
  color: var(--amm-accent);
}

.amm__empty {
  margin: 0;
  padding: 20px 0;
  font-size: 14px;
  line-height: 20px;
  color: #999;
}

/* ---------------- Systems：顶部容量标签 */

.amm__tabs {
  display: flex;
  gap: 32px;
  height: 97px;
  margin: 0;
  padding: 20px 260px;
  background: var(--amm-bg-subtle);
  list-style: none;
}

.amm__tab {
  display: flex;
  flex: 1;
  min-width: 0;
  background: var(--amm-bg-default);
  border-bottom: 1px solid var(--amm-border-control);
  transition: border-color 0.18s ease;
}

.amm__tab > a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.16px;
  color: var(--amm-text-strong);
  text-align: center;
  text-decoration: none;
}

.amm__tab.is-active,
.amm__tab:hover {
  background: var(--amm-surface);
  border-bottom-color: var(--amm-accent);
}

.amm__tab:hover > a {
  color: var(--amm-accent);
}

/* 悬停时红线跟着指针走，不再停在默认那一格 */
.amm__tabs:hover .amm__tab.is-active:not(:hover) {
  border-bottom-color: var(--amm-border-control);
}

.amm__tabs:hover .amm__tab.is-active:not(:hover) > a {
  color: var(--amm-text-strong);
}

/* ---------------- Systems：卡片区 */

.amm__main--sys {
  align-items: stretch;
  padding: 20px var(--amm-pad-x) 20px 20px;
}

.amm__main--sys .amm__grid-pane {
  display: none;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0; /* 允许收缩，卡片区才能接管滚动 */
}

.amm__main--sys .amm__grid-pane.is-active {
  display: flex;
}

.amm__syshead {
  padding: 20px;
  border-bottom: 1px solid var(--amm-border-control);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: var(--amm-text-strong);
}

.amm__sysgap {
  height: 20px;
}

/* 设计稿是两张大卡一行。固定两列，多出来的往下换行、在卡片区内竖向滚动，
   这样条数增加既不会把卡片压小，也不用横向拖。 */
.amm__syscards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--amm-border-control) var(--amm-surface-cool);
}

.amm__syscards::-webkit-scrollbar {
  width: 6px;
}

.amm__syscards::-webkit-scrollbar-track {
  background: var(--amm-surface-cool);
}

.amm__syscards::-webkit-scrollbar-thumb {
  background: var(--amm-border-control);
}

.amm__syscards::-webkit-scrollbar-thumb:hover {
  background: var(--amm-accent);
}

.amm__syscard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-width: 0;
  padding: 20px;
  text-decoration: none;
}

.amm__syscard-media {
  display: block;
  flex: none;
  width: 100%;
  height: 395px;
  overflow: hidden;
}

.amm__syscard-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.amm__syscard-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}

.amm__syscard-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 25px;
  letter-spacing: -0.36px;
  color: var(--amm-text-strong);
}

.amm__syscard-sub {
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--amm-text-primary);
}

.amm__syscard-btn {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  height: 40px;
  padding: 8px 22px;
  background: var(--amm-accent);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--amm-text-inverse);
  white-space: nowrap;
}

.amm__btn-arrow {
  flex: none;
  color: currentColor;
}

/* ---------------- Solutions：详情预览 */

.amm__main--detail {
  padding: 20px var(--amm-pad-x) 20px 0;
}

.amm__pane {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 20px;
}

.amm__pane.is-active {
  display: flex;
}

.amm__pane-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 32px;
  min-width: 0;
  padding: 0 32px;
}

.amm__pane-head {
  display: flex;
  flex-direction: column;
}

.amm__pane-eyebrow {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--amm-accent);
}

.amm__pane-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.24px;
  color: var(--amm-text-strong);
}

.amm__pane-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  margin: 0;
  max-height: 199px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--amm-text-primary);
}

.amm__pane-cta {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 16px;
  padding: 8px 22px;
  background: var(--amm-accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--amm-text-inverse);
}

.amm__pane-media {
  flex: none;
  width: 546px;
  max-width: 50%;
  height: 336px;
  overflow: hidden;
}

.amm__pane-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------------- 图片悬停放大（三种卡片共用）
   盒子已 overflow:hidden，放大的部分被裁掉，不会撑开布局 */

.amm__card-media img,
.amm__syscard-media img,
.amm__pane-media img {
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.amm__card:hover .amm__card-media img,
.amm__card:focus-visible .amm__card-media img,
.amm__syscard:hover .amm__syscard-media img,
.amm__syscard:focus-visible .amm__syscard-media img,
.amm__pane-media:hover img {
  transform: scale(1.1);
}

.amm__notice {
  padding: 12px 16px;
  background: var(--amm-bg-subtle);
  color: #666;
  font-size: 14px;
}

.amm a:focus-visible,
.amm [tabindex]:focus-visible {
  outline: 2px solid var(--amm-accent);
  outline-offset: 2px;
}

/* ---------------- 响应式
   断点与本站 Elementor 的自定义断点一致：1768 / 1400 / 1200 / 990 / 768。

   面板横向是「左栏 + 二级栏 + 产品网格」，固定开销 = 2×--amm-pad-x + 2×--amm-col + 44，
   剩下的才是网格。下面每档的取值都按「该档最窄处卡片仍 ≥170px」反推，
   保证任何宽度下图片和标题都不会被挤变形。

   一级项间距同理：横排 6 项里有 "Support & Service" 这种长标签，
   窄一点就得收间距，到 1200 直接换汉堡抽屉。 */

@media (max-width: 1768px) {
  .amm {
    --amm-pad-x: 80px;
    --amm-col: 300px;
  }

  .amm__top {
    gap: 28px;
  }

  .amm__tabs {
    padding-left: 100px;
    padding-right: 100px;
  }
}

@media (max-width: 1400px) {
  .amm {
    --amm-pad-x: 40px;
    --amm-col: 260px;
  }

  .amm__top {
    gap: 20px;
  }

  .amm__tabs {
    padding-left: 48px;
    padding-right: 48px;
    gap: 16px;
  }

  .amm__syscard-media { height: 260px; }
  .amm__pane-media { width: 420px; height: 260px; }
}

@media (max-width: 1200px) {
  /* 页头这一行放不下整条导航，收成汉堡 + 右侧滑出的抽屉。
     .amm 本身缩到只剩按钮那么大，页头才能回到一行高。 */
  .amm {
    display: flex;
    justify-content: flex-end;

    /* 抽屉内字号按视口宽度缩放：一级 3.8vw → 三级 3.2vw。
       上限必须封：抽屉断点一直到 1200px，不封顶 3.8vw 就是 45px。
       取 480px 视口时的值作为上限（18/17/15px），再往上抽屉本身已经固定
       360px 宽，字号继续涨没有意义。下限对应约 316px 视口，只是兜底，
       320px 以上的真机都跑在纯 vw 区间里。 */
    --amm-fs-lg: clamp(12px, 3.8vw, 18px);
    --amm-fs-md: clamp(11px, 3.5vw, 17px);
    --amm-fs-sm: clamp(10px, 3.2vw, 15px);
  }

  /* 行高改成无单位倍数，否则字号缩了行高还钉在 20px */
  .amm__top-link {
    font-size: var(--amm-fs-lg);
    line-height: 1.35;
  }

  .amm__item-text,
  .amm__tab > a {
    font-size: var(--amm-fs-md);
    line-height: 1.35;
  }

  /* 嵌在一级项里的二级列表（Products 的 .amm__subitem、Systems 的 .amm__item 都算） */
  .amm__sub .amm__item-text,
  .amm__viewall {
    font-size: var(--amm-fs-sm);
    line-height: 1.35;
  }

  .amm__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0 10px;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .amm__burger-bar {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--amm-text-strong);
    transition: transform 0.24s ease, opacity 0.18s ease;
  }

  /* 展开时三条变叉 */
  .amm.is-open .amm__burger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .amm.is-open .amm__burger-bar:nth-child(2) {
    opacity: 0;
  }

  .amm.is-open .amm__burger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .amm__scrim {
    display: block;
    position: fixed;
    inset: var(--amm-drawer-top, 0) 0 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.4);
    /* 收起时必须让出点击：只置 opacity:0 的话它照样铺满全屏吃掉所有点击 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s;
  }

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

  .amm__top {
    position: fixed;
    top: var(--amm-drawer-top, 0);
    right: 0;
    bottom: 0;
    z-index: 999;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: min(360px, 86vw);
    padding: 8px 20px 40px;
    background: var(--amm-bg-default);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    /* 关着的时候挪到屏幕外；fixed 元素不计入 scrollWidth，不会带出横向滚动条 */
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
      visibility 0.3s;
  }

  .amm.is-open .amm__top {
    transform: translateX(0);
    visibility: visible;
  }

  .amm__top-item {
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--amm-border);
  }

  .amm__top-link {
    justify-content: space-between;
    padding: 14px 0;
  }

  .amm__panel {
    position: static;
    width: auto;
  }

  .amm__panel-body,
  .amm__panel--columns .amm__panel-body,
  .amm__panel--detail .amm__panel-body,
  .amm__panel--tabs .amm__panel-body {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0 0 12px;
  }

  .amm__col,
  .amm__sub {
    width: auto;
    padding: 0;
  }

  .amm__main,
  .amm__main--sys,
  .amm__main--detail {
    display: block;
    padding: 0;
  }

  .amm__subwrap {
    padding: 8px 0;
  }

  .amm__indicator {
    display: none;
  }

  .amm__grids {
    padding: 12px 0;
  }

  .amm__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .amm__card { min-height: 0; }

  /* 桌面的横向标签条（Systems 的容量档 / Support & Service 这类单行栏目）
     在抽屉里就是普通的一列链接：去掉灰底、居中和 pill 边框，
     跟一级、二级项对齐成同一套行样式，否则一列里三种对齐方式很乱 */
  .amm__tabs {
    flex-direction: column;
    flex-wrap: nowrap;
    height: auto;
    gap: 0;
    padding: 0;
    background: transparent;
  }

  .amm__tab {
    flex: 0 0 auto;
    background: transparent;
    border-bottom: 1px solid var(--amm-surface-cool);
  }

  .amm__tab:last-child {
    border-bottom: 0;
  }

  .amm__tab.is-active,
  .amm__tab:hover {
    background: transparent;
    border-bottom-color: var(--amm-surface-cool);
  }

  .amm__tab.is-active > a {
    color: var(--amm-accent);
  }

  .amm__tab > a {
    justify-content: space-between;
    /* 左缩进对齐 .amm__item-link 的 20px，让它看起来是一级项的下一层 */
    padding: 13px 0 13px 20px;
    text-align: left;
  }

  /* 窄屏跟随页面滚动，不在卡片区内部滚 */
  .amm__syscards {
    overflow-y: visible;
  }

  .amm__syscard {
    padding: 12px 0;
    gap: 12px;
  }

  .amm__syscard-media { height: 180px; }

  .amm__pane {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0;
  }

  .amm__pane-text {
    padding: 0;
    gap: 16px;
  }

  .amm__pane-media {
    width: 100%;
    max-width: none;
    height: 200px;
    order: -1;
  }

  /* 桌面这里是 height:20px + overflow:hidden 的单行；抽屉里再加上内边距，
     border-box 下内容盒只剩 8px，文字被横切掉一截。改成按内容撑开。
     左缩进 20px 与 .amm__item-link 对齐 —— 它和一级分类是同一层。 */
  .amm__viewall {
    height: auto;
    padding: 14px 0 6px 20px;
  }

  /* 桌面靠「左栏 #f9f9f9 + 右栏白」分区，抽屉本身已经是白底，
     照搬过来就变成一条没来由的灰带，这里拍平，改用缩进表达层级 */
  .amm__panel {
    background: transparent;
  }

  /* --- 抽屉只做导航，不做预览。
     产品网格 / 系统卡 / 方案预览在桌面是「顺带看一眼」，竖排一列就是几百像素，
     一个一级栏目展开后要滚两屏还看不到下一个。二级分类点进去就是完整列表页，
     这里只保留到二级为止。 */
  .amm__panel--columns .amm__main,
  .amm__main--sys,
  .amm__main--detail {
    display: none;
  }

  /* --- 二级列表由 JS 嵌进了对应的一级项（见 mega-menu.js 的 nestSubs）。
     用网格排：第一行是「链接 | 展开按钮」，第二行整宽放二级列表。
     不用 flex-column 是因为那样链接和按钮会上下堆起来。 */
  .amm__item,
  .amm__tab {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  .amm__item > .amm__item-link,
  .amm__tab > a {
    grid-column: 1;
  }

  .amm__toggle {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 44px; /* 指尖热区，别做成 20px 的小箭头 */
    padding: 0;
    border: 0;
    background: none;
    color: var(--amm-text-primary);
    cursor: pointer;
  }

  .amm__sub {
    grid-column: 1 / -1;
  }

  .amm__toggle-icon {
    transition: transform 0.22s ease, color 0.18s ease;
  }

  .amm__toggle[aria-expanded="true"] .amm__toggle-icon {
    color: var(--amm-accent);
    transform: rotate(90deg);
  }

  /* 行尾已经有展开按钮了，链接里那个装饰箭头就是重复的 */
  .amm__item--has-sub > .amm__item-link .amm__arrow {
    display: none;
  }

  .amm__sub {
    width: auto;
    margin-left: 20px;
    padding: 0 0 8px 12px;
    border-left: 2px solid var(--amm-surface-cool);
  }

  .amm__sublist,
  .amm__sub .amm__list {
    gap: 0;
  }

  .amm__subitem:last-child {
    border-bottom: 0;
  }

  /* 一级项之间给条细线，六个分类竖排时才分得开 */
  .amm__list > .amm__item {
    border-bottom: 1px solid var(--amm-surface-cool);
  }

  .amm__list > .amm__item:last-child {
    border-bottom: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  .amm *,
  .amm *::before,
  .amm *::after {
    transition: none !important;
  }

  /* 关掉过渡还不够，放大本身也要停掉 */
  .amm__card:hover .amm__card-media img,
  .amm__syscard:hover .amm__syscard-media img,
  .amm__pane-media:hover img {
    transform: none;
  }
}
