/* ════════════════════════════════════════════════════════════════
   AccordionGallery · 手风琴图廊样式（官网原生等价实现）
   配合 assets/js/accordiongallery.js 使用；变量由 JS 写入 --ag-*
   设计口径：曜石黑底 + 霓虹青柠强调（站点唯一强调色 #ccff00）
   ════════════════════════════════════════════════════════════════ */

.ag {
  --ag-accent: #ccff00;
  --ag-overlay: #07080a;
  --ag-text: #eef1f4;
  --ag-gap: 10px;
  --ag-radius: 16px;
  --ag-media-size: 320px;
  --ag-dur: 0.6s;
  --ag-ease: cubic-bezier(0.22, 1, 0.36, 1);

  display: flex;
  flex-direction: row;
  gap: var(--ag-gap);
  width: 100%;
  max-width: 100%;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.ag-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--ag-radius);
  cursor: pointer;
  display: block;
  text-decoration: none;
  outline: none;
  transform-style: preserve-3d;
  transform-origin: center center;
  background: var(--bg-2, #101318);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  will-change: flex-grow, transform;
  -webkit-tap-highlight-color: transparent;
  transition:
    flex-grow var(--ag-dur) var(--ag-ease),
    transform var(--ag-dur) var(--ag-ease),
    box-shadow 0.35s var(--ag-ease);
}

.ag-panel:hover {
  box-shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.9);
}

.ag-panel:focus-visible {
  box-shadow:
    0 0 0 2px var(--ag-accent),
    0 10px 30px -18px rgba(0, 0, 0, 0.8);
}

.ag-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.ag-media {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ag-media-size);
  height: 100%;
  transform: translate(-50%, -50%);
  will-change: transform, filter;
  transition:
    transform var(--ag-dur) var(--ag-ease),
    filter var(--ag-dur) var(--ag-ease);
}

.ag-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* 底部可读性渐变（等价原版 ag-panel__overlay 第一层） */
.ag-ov {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    transparent 45%,
    color-mix(in srgb, var(--ag-overlay) 78%, transparent) 100%
  );
}

/* 收起态压暗（等价原版 --ag-dim；color-mix 改独立层 opacity 过渡，兼容更稳） */
.ag-dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: var(--ag-overlay);
  opacity: 0.35;
  transition: opacity var(--ag-dur) var(--ag-ease);
}

.ag-panel.is-open .ag-dim {
  opacity: 0;
}

/* 标签：竖条 + 主标题 + 副标题行 + 能力 chips */
.ag-label {
  position: absolute;
  left: 20px;
  bottom: 20px;
  right: 20px;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-14px);
  transition:
    opacity 0.36s var(--ag-ease),
    transform 0.36s var(--ag-ease);
}

.ag-panel.is-open .ag-label {
  opacity: 1;
  transform: none;
}

.ag-bar {
  flex: 0 0 auto;
  width: 3px;
  height: 26px;
  border-radius: 3px;
  margin-top: 4px;
  background: var(--ag-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--ag-accent) 60%, transparent);
  transition: height 0.36s var(--ag-ease);
}

.ag-panel.is-open .ag-bar {
  height: 44px;
}

.ag-text {
  color: var(--ag-text);
  font-weight: 600;
  font-size: clamp(1rem, 1.35vw, 1.3rem);
  letter-spacing: 0.01em;
  line-height: 1.35;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
  min-width: 0;
}

.ag-text b {
  display: block;
  font-weight: 600;
}

.ag-text i {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: 12.5px;
  color: rgba(238, 241, 244, 0.66);
  margin-top: 6px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.ag-text .chips {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ag-text .chips span {
  font-size: 11px;
  font-weight: 400;
  color: var(--lime-2, #a3cc00);
  border: 1px solid rgba(204, 255, 0, 0.3);
  border-radius: 99px;
  padding: 3px 10px;
  background: rgba(204, 255, 0, 0.08);
}

/* stagger：竖条先出、文字跟上（等价 GSAP stagger 0.06s） */
.ag-panel.is-open .ag-bar { transition-delay: 0s; }
.ag-panel.is-open .ag-text { transition-delay: 0.06s; }

/* 窄屏：横排转竖排（等价原版 orientation:vertical / max-width:520 分支） */
@media (max-width: 640px) {
  .ag {
    flex-direction: column;
    height: auto !important;
    perspective: none;
  }
  .ag-panel {
    min-height: 84px;
    transform: none !important;
  }
  .ag .ag-media {
    width: 100%;
    height: var(--ag-media-size);
  }
  .ag-text { font-size: 0.95rem; }
  .ag-text i { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .ag { --ag-dur: 0s; }
  .ag-panel,
  .ag-media,
  .ag-label,
  .ag-bar,
  .ag-text,
  .ag-dim {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
