/* ============================================================
 * AI 大模型对接（ai/index.php）专属样式
 * 设计参考：qingflow.com/qing-builder（单屏 hero + 点阵背景 +
 *   白色 composer 卡片 + 示例胶囊 + 黑色 CTA）
 * 配色换成本站品牌紫蓝（--aib-primary #423DFF），与 header/footer 协调
 * ============================================================ */

.aib-page {
    --aib-primary: #423DFF;
    --aib-primary-2: #5B57FF;
    --aib-ink: #0E1120;
    --aib-body: #3D4356;
    --aib-muted: #6B7280;
    --aib-line: #E9EBF3;
    --aib-soft: #F6F7FB;
    background: #fff;
}

/* ---------- 1. Hero ---------- */
.aib-hero {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;   /* 站点未开全局 border-box：height 需含 padding 计入 */
    height: 672px;   /* 固定舞台高度（2026-10-28 定稿）：24px 点阵网格 ×28，8/16/24/32/48/96 公倍数，shader 纵向单位 672×2/2.4=560px 整；= padding 116/103 + 内容 453 */
    display: flex;
    align-items: center;
    padding: 116px 0 103px;
    background: #fff;
}

/* 点阵背景：细密圆点，中心留白、两侧渐显（复刻 qing-builder 的弧状点阵） */
.aib-hero__dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* 双层**方形**点阵（2026-10-28 定稿）：24px 小点密铺 + 48px 大点，大点落在小点奇数格上。
       边长 2.5px / 4.0px（原圆点面积等价值 2.48/3.81 的圆整值；不取整，靠精确坐标保行列对齐）。
       用 SVG data URI 画孤立方块：linear-gradient / repeating-linear-gradient 都会填满
       整个 tile 或叠成网格线，画不出单个点。
       tile 内坐标：小点圆心 (12,12) → 方块左上 (10.75,10.75)；
                    大点圆心在 tile 内 24 → 左上 (22,22)，经 background-position 12px 后
                    绝对圆心 = 12 + 22 + 2 = 36 ✓
       本层是 canvas 不可用 / reduced-motion 时的静态兜底，透明度 .24/.34 */
    background-image:
        url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%3E%3Crect%20x='10.75'%20y='10.75'%20width='2.5'%20height='2.5'%20fill='%2358d0ee'%20fill-opacity='0.24'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='48'%20height='48'%3E%3Crect%20x='22'%20y='22'%20width='4'%20height='4'%20fill='%2358d0ee'%20fill-opacity='0.34'/%3E%3C/svg%3E");
    background-size: 24px 24px, 48px 48px;
    background-position: 0 0, 12px 12px;
    -webkit-mask-image: radial-gradient(ellipse 44% 74% at 50% 40%, transparent 22%, #000 92%);
    mask-image: radial-gradient(ellipse 44% 74% at 50% 40%, transparent 22%, #000 92%);
}

/* ---------- WebGL2 漩涡点阵（2026-10-28 定稿，替换原地微闪） ----------
   由片元着色器逐像素绘制：pxSize 格子 + Bayer 4×4 二值抖动，无逐点状态。
   参数 u_scale=2.0 / 时间倍速 0.3 / u_pxSize=2.5，旋臂约 20s 走完一轮。
   本层默认 display:none，JS 成功初始化后才由 .is-twinkle 打开。 */
.aib-hero__twinkle {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* 无 CSS 遮罩：空白由着色器漩涡奇点生成（奇点固定在画布中心 = 文案中心），
       叠遮罩反而会削掉螺旋臂。见 ai/index.php 里的 aibSwirl 注释。 */
}

/* JS 启动后加 .is-twinkle，同时隐藏静态底层（canvas 会完整重绘所有点） */
.aib-hero.is-twinkle .aib-hero__twinkle { display: block; }
.aib-hero.is-twinkle .aib-hero__dots { display: none; }

/* 顶部再压一层白雾，让标题区更干净 */
.aib-hero::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 96px;
    background: linear-gradient(180deg, #fff 18%, rgba(255, 255, 255, 0));
    pointer-events: none;
}

/* 底部同款白雾：点阵在 hero 下边界淡出，避免与下一屏白底硬切 */
.aib-hero::before {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 132px;
    background: linear-gradient(0deg, #fff 14%, rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 0;
}

.aib-hero .container {
    position: relative;
    z-index: 1;
    width: 100%;      /* hero flex 垂直居中后，container 需占满行宽保持水平居中 */
    min-width: 0;     /* flex 子项 min-width:auto 陷阱：composer 工具条 min-content≈620px 会顶穿窄视口 */
}

.aib-hero__inner {
    text-align: center;
}

.aib-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px 5px 10px;
    border-radius: 999px;
    background: rgba(66, 61, 255, .06);
    border: 1px solid rgba(66, 61, 255, .14);
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--aib-primary);
}

.aib-hero__eyebrow i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2BC8B4;
    box-shadow: 0 0 6px rgba(43, 200, 180, .6);
}

.aib-hero__title {
    margin: 22px 0 0;
    font-size: clamp(34px, 4.1vw, 56px);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -.022em;
    color: var(--aib-ink);
}

.aib-hero__title em {
    font-style: normal;
    background: linear-gradient(96deg, #423DFF 0%, #6E6BFF 52%, #2BC8B4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.aib-hero__sub {
    max-width: 660px;
    margin: 18px auto 0;
    font-size: 16px;
    line-height: 1.75;
    color: var(--aib-muted);
}

/* ---------- composer 卡片（照搬 qing-builder 输入框形态） ---------- */
.aib-composer {
    width: min(830px, 100%);
    box-sizing: border-box;      /* content-box 下 padding+border 会把卡片撑出容器（768 下溢出 38px） */
    margin: 40px auto 0;
    padding: 18px 18px 14px;
    background: #fff;
    border: 1px solid var(--aib-line);
    border-radius: 18px;
    box-shadow: 0 26px 64px -38px rgba(18, 22, 58, .30), 0 2px 6px rgba(18, 22, 58, .04);
    text-align: left;
    transition: border-color .18s, box-shadow .18s;
}

.aib-composer:focus-within {
    border-color: rgba(66, 61, 255, .42);
    box-shadow: 0 26px 64px -30px rgba(66, 61, 255, .30), 0 0 0 4px rgba(66, 61, 255, .07);
}

.aib-composer__field {
    display: flex;
    align-items: center;
}

.aib-composer__field input {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: var(--aib-ink);
}

.aib-composer__field input::placeholder {
    color: #A5A9BA;
}

.aib-composer__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.aib-composer__plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--aib-line);
    border-radius: 50%;
    font-size: 15px;
    line-height: 1;
    color: #8A90A6;
    user-select: none;
}

.aib-composer__model {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 8px;
    background: var(--aib-soft);
    font-size: 12.5px;
    color: #4A5068;
    user-select: none;
}

.aib-composer__model i {
    font-style: normal;
    font-size: 9px;
    color: #9AA0B4;
}

.aib-composer__spacer {
    flex: 1;
}

.aib-composer__agent {
    font-size: 12.5px;
    color: #8A90A6;
    user-select: none;
}

.aib-composer__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--aib-ink);
    color: #fff;
    cursor: pointer;
    transition: background .18s, transform .18s;
}

.aib-composer__send:hover {
    background: var(--aib-primary);
    transform: translateY(-1px);
}

.aib-composer__send svg {
    width: 15px;
    height: 15px;
    display: block;
}

/* ---------- 示例胶囊 ---------- */
.aib-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.aib-chip {
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--aib-line);
    font-size: 13px;
    color: #4A5068;
    text-decoration: none;
    transition: color .18s, border-color .18s, background .18s, box-shadow .18s;
}

.aib-chip:hover {
    color: var(--aib-primary);
    border-color: #C9C6FF;
    background: #F6F5FF;
    box-shadow: 0 6px 16px -10px rgba(66, 61, 255, .45);
}

.aib-hero__foot {
    margin: 26px 0 0;
    font-size: 13px;
    color: #8A90A6;
}

.aib-hero__foot a {
    color: var(--aib-primary);
    text-decoration: none;
    border-bottom: 1px dashed rgba(66, 61, 255, .35);
}

/* ---------- 2. 通用区块头 ---------- */
.aib-sec {
    padding: 84px 0;
}

.aib-sec--soft {
    background: #FAFBFF;
    border-top: 1px solid #F0F2F9;
    border-bottom: 1px solid #F0F2F9;
}

.aib-sec__head {
    max-width: 760px;
}

.aib-sec__eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: 2px;
    color: #4A8FD8;
}

.aib-sec__eyebrow i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2BC8B4;
}

.aib-sec__title {
    margin: 0;
    font-size: clamp(24px, 2.5vw, 34px);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -.015em;
    color: var(--aib-ink);
}

.aib-sec__desc {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.8;
    color: var(--aib-muted);
}

/* 左文右卡布局 */
.aib-build {
    display: grid;
    grid-template-columns: 1fr 452px;
    gap: 64px;
    align-items: start;
}

.aib-caps {
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.aib-caps li {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid #F0F2F9;
}

.aib-caps li:first-child {
    border-top: 0;
    padding-top: 0;
}

.aib-caps__no {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    color: #B9BEE0;
    padding-top: 3px;
}

.aib-caps__t {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--aib-ink);
}

.aib-caps__d {
    margin: 6px 0 0;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--aib-muted);
}

/* 小琳实例卡（深色，形成视觉锚点） */
.aib-demo {
    position: relative;
    padding: 26px 24px 22px;
    border-radius: 20px;
    background: linear-gradient(165deg, #14162B 0%, #0E1022 62%, #101438 100%);
    box-shadow: 0 30px 70px -40px rgba(16, 18, 40, .7);
    overflow: hidden;
}

.aib-demo::after {
    content: '';
    position: absolute;
    right: -80px;
    top: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(66, 61, 255, .55) 0%, rgba(66, 61, 255, 0) 68%);
}

.aib-demo__head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    font-size: 12px;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .62);
}

.aib-demo__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2BC8B4;
    box-shadow: 0 0 8px rgba(43, 200, 180, .8);
}

.aib-demo__live {
    margin-left: auto;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(43, 200, 180, .14);
    border: 1px solid rgba(43, 200, 180, .3);
    font-size: 11px;
    color: #6EE7D4;
}

.aib-msg {
    position: relative;
    max-width: 92%;
    padding: 11px 14px;
    border-radius: 13px;
    font-size: 13.5px;
    line-height: 1.7;
}

.aib-msg--user {
    margin-left: auto;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .10);
    color: rgba(255, 255, 255, .88);
    border-bottom-right-radius: 4px;
}

.aib-msg--bot {
    margin-top: 10px;
    background: rgba(66, 61, 255, .16);
    border: 1px solid rgba(108, 106, 255, .28);
    color: rgba(255, 255, 255, .92);
    border-bottom-left-radius: 4px;
}

.aib-msg--bot b {
    color: #A9A6FF;
    font-weight: 700;
}

.aib-src {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.aib-src span {
    padding: 3px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .07);
    font-size: 11.5px;
    color: rgba(255, 255, 255, .58);
}

.aib-demo__foot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 12px;
    color: rgba(255, 255, 255, .45);
}

.aib-demo__foot a {
    margin-left: auto;
    color: #A9A6FF;
    text-decoration: none;
}

/* ---------- 3. 服务流程 ---------- */
.aib-flow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    margin-top: 44px;
}

.aib-flow__item {
    position: relative;
    padding-top: 22px;
    border-top: 2px solid #EDEFF7;
}

.aib-flow__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: -5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aib-primary);
    box-shadow: 0 0 0 4px rgba(66, 61, 255, .12);
}

.aib-flow__step {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    letter-spacing: .1em;
    color: #9AA0B4;
}

.aib-flow__t {
    margin: 8px 0 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--aib-ink);
}

.aib-flow__d {
    margin: 8px 0 0;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--aib-muted);
}

.aib-flow__tag {
    display: inline-block;
    margin-top: 12px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--aib-soft);
    font-size: 11.5px;
    color: #7A80A0;
}

/* ---------- 4. CTA ---------- */
.aib-cta {
    padding: 0 0 88px;
}

.aib-cta__box {
    position: relative;
    padding: 46px 48px;
    border-radius: 24px;
    background: linear-gradient(118deg, #3B36F0 0%, #423DFF 42%, #6A66FF 100%);
    overflow: hidden;
}

.aib-cta__box::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -120px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 70%);
}

/* 右上角点阵云：沿用首屏语言，让右侧留白有内容 */
.aib-cta__box::before {
    content: '';
    position: absolute;
    right: -30px;
    top: -40px;
    width: 460px;
    height: 340px;
    /* 间距 22 → 24，与 hero 主点阵统一（24 是 12 的倍数，能整除 72/96/120/144） */
    background-image: radial-gradient(circle, rgba(255, 255, 255, .30) 1.7px, transparent 1.8px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(circle at 68% 34%, #000 12%, rgba(0, 0, 0, 0) 70%);
    mask-image: radial-gradient(circle at 68% 34%, #000 12%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.aib-cta__t {
    position: relative;
    margin: 0;
    max-width: 720px;
    font-size: clamp(22px, 2.3vw, 30px);
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.01em;
    color: #fff;
}

.aib-cta__d {
    position: relative;
    margin: 12px 0 0;
    font-size: 14.5px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .78);
}

.aib-cta__btns {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.aib-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s, background .18s, color .18s;
}

.aib-btn--solid {
    background: #fff;
    color: var(--aib-primary);
    box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .45);
}

.aib-btn--solid:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px -16px rgba(0, 0, 0, .5);
}

.aib-btn--ghost {
    border: 1px solid rgba(255, 255, 255, .42);
    color: #fff;
}

.aib-btn--ghost:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .7);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .aib-build {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .aib-demo {
        max-width: 520px;
    }
}

@media (max-width: 992px) {
    .aib-hero { height: auto; padding: 68px 0 64px; }   /* 移动端恢复自然高度 */

    /* 窄屏点阵：宽椭圆会把点全推到视口外，改成扁平椭圆只留上下两带 */
    .aib-hero__dots {
        -webkit-mask-image: radial-gradient(ellipse 92% 46% at 50% 36%, transparent 24%, #000 94%);
        mask-image: radial-gradient(ellipse 92% 46% at 50% 36%, transparent 24%, #000 94%);
    }

    .aib-sec { padding: 64px 0; }

    .aib-flow {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 26px;
    }

    .aib-cta__box { padding: 40px 32px; }
}

@media (max-width: 640px) {
    .aib-hero { padding: 52px 0 52px; }

    .aib-hero__sub { font-size: 14.5px; }

    .aib-composer {
        margin-top: 28px;
        padding: 14px 14px 12px;
        border-radius: 15px;
    }

    .aib-composer__bar { flex-wrap: wrap; row-gap: 8px; }

    .aib-chips { gap: 8px; }

    .aib-chip {
        padding: 7px 13px;
        font-size: 12.5px;
    }

    .aib-sec { padding: 52px 0; }

    .aib-flow { grid-template-columns: 1fr; }

    .aib-cta { padding-bottom: 60px; }

    .aib-cta__box {
        padding: 32px 22px;
        border-radius: 18px;
    }

    .aib-btn { padding: 11px 20px; font-size: 14px; }
}
/* ---------- 动效降级：系统开启「减少动态效果」时关闭聚光（保持静态点阵） ---------- */
@media (prefers-reduced-motion: reduce) {
    .aib-hero__twinkle { display: none !important; }
    .aib-hero.is-twinkle .aib-hero__dots { display: block; }
}
