/* ==========================================================================
   productindex 字母索引列表页样式
   设计原则：克制、清晰、信息优先，避免过度装饰
   ========================================================================== */

:root {
    --alpha-stuck-offset: 60px;                                    /* fixed-header 高度 */
    --alpha-bg: rgba(20, 30, 50, 0.92);
    --alpha-text: #cdd6e4;
    --alpha-text-strong: #ffffff;
    --alpha-text-dim: rgba(205, 214, 228, 0.55);
    --alpha-accent: linear-gradient(90deg, #53FECD 0%, #2C74C9 100%);   /* 站点 active 品牌渐变 */
    --alpha-hover-glow: rgb(48, 221, 251);                              /* 站点 hover 青色辉光 */
    --alpha-border: rgba(255, 255, 255, 0.06);
    --alpha-divider: rgba(255, 255, 255, 0.05);
}

html { scroll-behavior: smooth; }

/* ---------- main 背景：从中间向外扩散的径向渐变 ----------
   仅在含 .list-cate-alpha 的页面生效，不污染其它列表页 */
body:has(.list-cate-alpha) {
    background-image: radial-gradient(
        ellipse 70% 60% at 50% 50%,
        rgba(44, 116, 201, 0.18) 0%,        /* 中心：站点品牌蓝低饱和 */
        rgba(44, 116, 201, 0.06) 35%,
        transparent 75%                      /* 外缘完全透明，让 body 背景透出 */
    );
    background-repeat: no-repeat;
    background-attachment: fixed;            /* 渐变跟随视口固定，滚动时如氛围光 */
    background-position: center;
}

/* ---------- 容器 ---------- */
.list-cate-alpha {
    margin: 20px 0 40px;
}

/* ---------- 顶部字母导航（吸顶） ---------- */
.list-cate-alpha .alpha-nav {
    display: grid;
    /* 每个按钮最小 34px，剩余空间均分；容器变窄时自动换行 */
    grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
    gap: 4px;
    padding: 10px 14px;
    background: var(--alpha-bg);
    border: 1px solid var(--alpha-border);
    border-radius: 8px;
    position: sticky;
    top: var(--alpha-stuck-offset);
    z-index: 5;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.list-cate-alpha .alpha-nav a {
    /* grid 子项天然填充列宽，无需 flex/min-width；用 min-width: 0 防止内容撑破 */
    min-width: 0;
    padding: 6px 10px;
    text-align: center;
    font-size: 14px;
    color: var(--alpha-text);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
    cursor: pointer;
    user-select: none;
}
.list-cate-alpha .alpha-nav a:hover {
    color: var(--alpha-text-strong);
    box-shadow: 0 0 5px 0 var(--alpha-hover-glow);                      /* 站点同款青色辉光 */
}
.list-cate-alpha .alpha-nav a.active,
.list-cate-alpha .alpha-nav a.active:hover {
    background: var(--alpha-accent);                                    /* 站点品牌渐变 */
    color: var(--alpha-text-strong);
    box-shadow: none;                                                   /* active 态不叠辉光，与 .list-cate a.active 一致 */
}
.list-cate-alpha .alpha-nav a.disabled {
    color: var(--alpha-text-dim);
    pointer-events: none;
}

/* ---------- 字母分组列表 ---------- */
.list-cate-alpha .alpha-list {
    margin-top: 12px;
}

.list-cate-alpha .letter-group {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 24px;
    padding: 28px 0 20px;
    /* border-top: 1px solid var(--alpha-divider); */
    /* fixed-header(60) + sticky alpha-nav(~52) + 间距 */
    scroll-margin-top: 130px;
}
.list-cate-alpha .letter-group:first-child {
    border-top: none;
    padding-top: 4px;
}

/* 大字母标签：单色低对比，作为视觉锚点不抢戏 */
.list-cate-alpha .letter-label {
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1px;
    color: rgba(120, 145, 200, 0.22);
    user-select: none;
}

/* 右侧条目网格 */
.list-cate-alpha .letter-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 24px;
    align-content: center;
}
.list-cate-alpha .letter-items a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 15px;
    color: var(--alpha-text);
    text-decoration: none;
    transition: color .2s ease;
    min-width: 0;
}
.list-cate-alpha .letter-items a > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.list-cate-alpha .letter-items a:hover {
    color: var(--alpha-hover-glow);                                    /* 与 alpha-nav hover 辉光同源（站点常用 rgb(48,221,251)） */
}
.list-cate-alpha .letter-items a img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ---------- 响应式 ---------- */

/* iPad / 平板：3 列 */
@media (max-width: 1024px) {
    .main .list-title {
        margin: 0 16px;
        margin-left: 16px !important;
    }
    .list-cate-alpha {
        padding: 0 16px;
    }
    .list-cate-alpha .letter-group {
        grid-template-columns: 72px 1fr;
        gap: 18px;
        padding: 22px 0 16px;
    }
    .list-cate-alpha .letter-label { font-size: 52px; }
    .list-cate-alpha .letter-items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px 18px;
    }

    /* mobile_public.css 给 .main 设了 overflow: hidden，会让 .main 变成
       sticky 的滚动容器导致 sticky 失效。仅在当前 alpha 索引页撤销 */
    .main:has(.list-cate-alpha) { overflow: visible !important; }
}

/* 手机：2 列 */
@media (max-width: 768px) {
    .list-cate-alpha { margin: 14px 0 30px; }

    .list-cate-alpha .alpha-nav {
        grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
        gap: 2px;
        padding: 8px 10px;
    }
    .list-cate-alpha .alpha-nav a {
        padding: 5px 7px;
        font-size: 13px;
    }

    /* 移动端：letter-label 上下堆叠（位于 letter-items 上方） */
    .list-cate-alpha .letter-group {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 18px 0 12px;
    }
    .list-cate-alpha .letter-label {
        font-size: 32px;
        line-height: 1;
    }
    .list-cate-alpha .letter-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 12px;
    }
    .list-cate-alpha .letter-items a { font-size: 14px; }
}

/* 超小屏：单列 */
@media (max-width: 360px) {
    .list-cate-alpha .letter-items {
        grid-template-columns: 1fr;
    }
}

/* 减少动画：尊重系统偏好 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .list-cate-alpha .alpha-nav a,
    .list-cate-alpha .letter-items a {
        transition: none;
    }
}
