/* ==========================================================================
   新派网络 · 首页样式
   依赖：tokens.css、common.css、components.css
   Hero 范式：纸白底 + 双层品牌光晕 + 点阵/网格双纹理，无渐变横幅
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero-section {
    position: relative;
    padding: 96px 0 28px;
    background: var(--bg-page);
    overflow: hidden;
}

/* Hero 顶部静态光晕：与全站页头 page-header.css 同一配方（双柔光错开） */
.hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 62% 100% at 50% 0%,
            rgba(0, 82, 255, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 42% 70% at 16% 6%,
            rgba(0, 122, 255, 0.05) 0%, transparent 72%);
}

/* 点阵 + 细网格双纹理：纯 CSS 生成，中心向边缘渐隐，无图片请求 */
.hero-dots {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(24, 24, 27, 0.075) 1px, transparent 1.5px),
        linear-gradient(rgba(24, 24, 27, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 24, 27, 0.028) 1px, transparent 1px);
    background-size: 26px 26px, 26px 26px, 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 68% 64% at 50% 16%,
        rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 78%);
    mask-image: radial-gradient(ellipse 68% 64% at 50% 16%,
        rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 78%);
    pointer-events: none;
}

/* 网格方块：方块预置于 HTML、明暗动画由 CSS keyframes 驱动（不依赖 JS/gsap），
   JS 随机决定显示数量、随机落到 26px 网格格位并错开周期与相位 */
/* 方块压在内容之下、纹理之上；复用 .hero-dots 的径向遮罩，
   使方块与网格纹理在同一区域渐隐，边缘不突兀 */
.hero-tiles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(ellipse 68% 64% at 50% 16%,
        rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 78%);
    mask-image: radial-gradient(ellipse 68% 64% at 50% 16%,
        rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 78%);
}

.hero-section > .container {
    position: relative;
    z-index: 2;
}

/* 方块本体：尺寸固定为一格（26px），由 JS 吸附到网格格位，与背景网格严丝合缝 */
.tile {
    position: absolute;
    display: block;
    width: 26px;
    height: 26px;
    /* 与 .hero-glow 同一支品牌蓝（#0052FF） */
    background: var(--primary);
    opacity: 0;
    animation: tileBlink 1.8s ease-in-out infinite;
    animation-delay: var(--tile-delay, 0s);
    animation-duration: 1.8s !important;
    animation-iteration-count: infinite !important;
}

/* 只动 opacity，走合成层，不触发布局与重绘；尺寸始终不变。
   峰值 0.09，比 .hero-glow 的 0.07 略高一点点，只做极轻的点亮 */
@keyframes tileBlink {
    0%   { opacity: 0; }
    40%  { opacity: 0.09; }
    100% { opacity: 0; }
}

/* 相位由 JS 随机注入（--tile-delay）以错开各块亮起时间，周期固定；
   此处为 JS 未执行时的兜底值 */
.tile:nth-child(3n+1) { --tile-delay: -0.5s; }
.tile:nth-child(3n+2) { --tile-delay: -1.1s; }
.tile:nth-child(3n)   { --tile-delay: -1.6s; }

/* 根因：common.css 末尾的 @media (prefers-reduced-motion: reduce) 对
   * / *::before / *::after 施加 animation-duration:0.01ms !important 与
   animation-iteration-count:1 !important，本机开启"减少动态效果"时全站
   CSS 动画被瞬间跑完 1 次后归零——此前光晕动画不出现亦是此因。
   此处以更高特异性（.scan-track-h::after / .scan-track-v::after）的
   !important 覆盖；若需完全顺从系统偏好，删掉上面两处 !important 行。 */

.hero-title {
    font-size: clamp(32px, 5vw, 50px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.18;
    color: var(--text-primary);
    margin-bottom: 22px;
}

.hero-subtitle {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   Hero 搜索框
   -------------------------------------------------------------------------- */

.search-container {
    max-width: 560px;
    margin: 36px auto 0;
}

.search-input-group {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-default);
    transition: border-color var(--duration-fast) var(--ease),
        box-shadow var(--duration-fast) var(--ease);
}

.search-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-md);
}

.search-input {
    border: none;
    padding: 15px 20px;
    font-size: 15px;
    height: 56px;
    background: var(--white);
    color: var(--text-primary);
    box-shadow: none !important;
}

.search-btn {
    width: 72px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    background: var(--primary);
    transition: background var(--duration-fast) var(--ease);
}

.search-btn:hover {
    background: var(--primary-hover) !important;
}

/* --------------------------------------------------------------------------
   Hero 统计条：三项数字，服务端渲染（搜索框下方）
   -------------------------------------------------------------------------- */

/* 与搜索框 .search-container 同宽（560px）并居中；四项数据单行排布不换行 */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(8px, 1.6vw, 18px);
    max-width: 560px;
    margin: 40px auto 0;
    padding: 16px 18px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    box-shadow: var(--shadow-sm);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 72px;
}

.hero-stat-value {
    font-size: clamp(21px, 2.2vw, 26px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
    line-height: 1;
}

.hero-stat-label {
    font-size: 12px;
    color: var(--gray-400);
    letter-spacing: 0.02em;
}

.hero-stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border-default);
}

/* --------------------------------------------------------------------------
   分类胶囊（filter-tab = chip）
   -------------------------------------------------------------------------- */

.category-filter {
    margin-top: 48px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
}

/* 胶囊：宽松内距 + 大圆角（不再用全药丸形） */
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
}

.filter-tab i {
    font-size: 14px;
    color: var(--gray-500);
    transition: color var(--duration-fast) var(--ease);
}

.filter-tab:hover {
    border-color: var(--gray-300);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    box-shadow: var(--shadow-primary);
}

.filter-tab.active i {
    color: var(--on-primary);
}

/* --------------------------------------------------------------------------
   区块节奏：大留白撑起高级感（每区之间 72px 呼吸间距）
   -------------------------------------------------------------------------- */

#softwareGrid {
    justify-content: flex-start;
}

.featured-software {
    padding: 8px 0 0;
}

/* --------------------------------------------------------------------------
   分类导航区
   -------------------------------------------------------------------------- */

.category-nav-section {
    padding: 52px 0 0;
}

.category-nav-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    height: 100%;
    padding: 13px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    text-decoration: none;
    transition: border-color var(--duration-fast) var(--ease),
        box-shadow var(--duration-normal) var(--ease),
        transform var(--duration-normal) var(--ease);
}

/* 与软件卡片完全同一套 hover 语言：边框加深 + 投影抬升 + 轻微上移 */
.category-nav-card:hover,
.category-nav-card:focus-visible {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.category-nav-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    transition: background var(--duration-fast) var(--ease),
        color var(--duration-fast) var(--ease);
}

/* hover 仅填充品牌蓝，不做缩放 */
.category-nav-card:hover i {
    background: var(--primary);
    color: var(--on-primary);
}

.category-nav-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    transition: color var(--duration-fast) var(--ease);
}

.category-nav-card:hover .category-nav-name {
    color: var(--primary);
}

/* 单行截断：分类卡高度是整块区域占比主因，描述不再撑两行 */
.category-nav-desc {
    font-size: 12px;
    line-height: 1.45;
    color: var(--gray-500);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-nav-count {
    margin-top: auto;
    padding-top: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}

/* --------------------------------------------------------------------------
   信任区：深色数据横幅（圆角不贴边，与页脚保持浅色间隔）
   高晕置于左列标题上方，底色带纵深微渐变
   -------------------------------------------------------------------------- */

.trust-section {
    padding: 20px 0 24px;
}

.stats-band {
    background: linear-gradient(135deg, #171A20 0%, #0F1116 60%, #12151B 100%);
    border-radius: var(--radius-xl);
    padding: clamp(22px, 3.2vw, 34px);
    overflow: hidden;
    position: relative;
}

/* 品牌蓝光晕：落在左列「值得信赖的选择」标题上方 */
.stats-band::before {
    content: '';
    position: absolute;
    top: -220px;
    left: -60px;
    width: 620px;
    height: 520px;
    background: radial-gradient(ellipse at center,
        rgba(0, 92, 255, 0.30) 0%,
        rgba(0, 82, 255, 0.12) 42%,
        transparent 70%);
    pointer-events: none;
}

.stats-band-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}

.stats-band-eyebrow {
    margin: 0 0 10px;
    color: #6C9BFF;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1;
}

.stats-band-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 10px;
}

.stats-band-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-400);
    margin: 0;
}

.stats-band-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stats-band-point {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(2px);
    transition: border-color var(--duration-fast) var(--ease),
        background var(--duration-fast) var(--ease);
}

.stats-band-point:hover {
    border-color: rgba(108, 155, 255, 0.45);
    background: rgba(0, 82, 255, 0.08);
}

.stats-band-point i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: rgba(0, 92, 255, 0.20);
    color: #8FB4FF;
    font-size: 15px;
}

.stats-band-point h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
    margin: 0 0 3px;
}

.stats-band-point p {
    font-size: 13px;
    color: var(--gray-400);
    margin: 0;
}

/* --------------------------------------------------------------------------
   阅读进度条（gsap-animations.js 驱动）
   -------------------------------------------------------------------------- */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: var(--primary);
    z-index: 2000;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .stats-band-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 64px 0 40px;
    }

    .hero-title {
        /* 移动端随视口收敛字号，避免长标题折行 */
        font-size: clamp(22px, 6.4vw, 27px);
        line-height: 1.25;
        margin-bottom: 16px;
    }

    .search-container {
        margin: 28px auto 0;
    }

    .hero-stats {
        gap: 10px;
        padding: 16px 12px;
        margin-top: 32px;
    }

    .hero-stat {
        min-width: 0;
    }

    .hero-stat-label {
        white-space: nowrap;
    }

    .hero-stat-divider {
        height: 28px;
    }

    .category-filter {
        margin-top: 28px;
    }

    .filter-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 -12px;
        padding: 0 12px 4px;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .featured-software {
        padding-top: 16px;
    }

    .category-nav-section {
        padding-top: 36px;
    }

    .trust-section {
        padding: 18px 0 20px;
    }
}

/* 超窄屏（手机）：统计条改 2×2，四项数字再长也不会溢出卡片 */
@media (max-width: 575.98px) {
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 10px;
        padding: 14px 12px;
    }

    .hero-stat-divider {
        display: none;
    }

    .hero-stat {
        min-width: 0;
    }

    .hero-stat-value {
        font-size: 20px;
    }
}
