/* kanju 主题 · AI 对话页（任务 6） */
.k-chat {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 2rem);
    max-width: 52rem;
    margin: 0 auto;
    gap: 0.75rem;
    padding-top: 0.75rem;
}

.k-chat__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--k-border-soft);
}

.k-chat__head-text { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.k-chat__brand { font-size: 1.0625rem; font-weight: 600; color: var(--k-text); }


.k-chat__head a.k-page__back,
.k-chat__head > a:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    color: var(--k-text-muted);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}

.k-chat__head a.k-page__back:hover,
.k-chat__head > a:first-child:hover {
    background: rgb(255 255 255 / 6%);
    color: var(--k-text);
}

.k-chat__mode:hover {
    border-color: rgb(var(--k-primary-rgb) / 42%);
}

.k-chat__head .k-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--k-text-muted);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.k-chat__head .k-iconbtn:hover {
    background: rgb(255 255 255 / 6%);
    color: var(--k-text);
}

.k-chat__mode {
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--k-border);
    background: rgb(var(--k-primary-rgb) / 10%);
    color: var(--k-primary);
    font-size: var(--k-fs-xs);
}

.k-chat__log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.k-chat__empty {
    margin: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-items: center;
}

.k-chat__empty-title { margin: 0; font-size: 1.375rem; font-weight: 600; color: var(--k-text); }
.k-chips--center { justify-content: center; }

/* 气泡 */
.k-msg { display: flex; gap: 0.5rem; max-width: 88%; animation: k-msg-in 0.2s ease; }

@keyframes k-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .k-msg { animation: none; }
}
.k-msg--user { align-self: flex-end; flex-direction: row-reverse; }
.k-msg--ai { align-self: flex-start; }

.k-msg__avatar {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgb(var(--k-primary-rgb) / 14%);
    color: var(--k-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--k-fs-xs);
    font-weight: 700;
}

.k-msg__bubble {
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    font-size: var(--k-fs-base);
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.k-msg--user .k-msg__bubble {
    background: var(--k-primary);
    color: var(--k-primary-ink, #07140f);
    border-bottom-right-radius: 0.25rem;
}

.k-msg--ai .k-msg__bubble {
    background: var(--k-card);
    border: 1px solid var(--k-interactive-border);
    color: var(--k-text);
    border-bottom-left-radius: 0.25rem;
}

/* 逐字输出光标 */

.k-msg--typing .k-msg__bubble {
    min-height: 2.5rem;
}

.k-msg--typing .k-msg__bubble::after {
    content: "▌";
    margin-left: 0.125rem;
    color: var(--k-primary);
    animation: k-caret 1s steps(2, start) infinite;
}

@keyframes k-caret { to { visibility: hidden; } }

.k-msg--error .k-msg__bubble {
    border-color: var(--k-warning-border);
    background: var(--k-warning-bg);
    color: var(--k-warning);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}


.k-msg__retry {
    margin-top: 0.375rem;
    display: inline-flex;
    padding: 0.1875rem 0.625rem;
    border-radius: 0.3125rem;
    border: 1px solid var(--k-warning-border);
    background: transparent;
    color: var(--k-warning);
    font-family: inherit;
    font-size: var(--k-fs-sm);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
}

/* composer */
.k-chat__form {
    position: sticky;
    bottom: 0;
    z-index: 5;
    border-radius: 1rem;
    border: 1px solid var(--k-border);
    background: var(--k-card);
    padding: 0.625rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 -10px 28px rgb(0 0 0 / 22%);
}

.k-chat__chip {
    align-self: flex-start;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--k-border);
    background: rgb(var(--k-primary-rgb) / 10%);
    color: var(--k-primary);
    font-size: var(--k-fs-xs);
}

.k-chat__row { display: flex; align-items: center; gap: 0.5rem; }

.k-chat__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--k-text);
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem 0.25rem;
    outline: none;
}

.k-chat__input::placeholder { color: var(--k-text-subtle); }

@media (max-width: 1023.98px) {
    /* 贴齐页边；高度只给胶囊 tabbar 留空（约 5.25rem），避免 composer 与底栏之间大空洞 */
    .k-chat {
        max-width: none;
        width: calc(100% + 2 * var(--k-page-edge, 17px));
        margin-left: calc(-1 * var(--k-page-edge, 17px));
        margin-right: calc(-1 * var(--k-page-edge, 17px));
        padding: 0.5rem var(--k-page-edge, 17px) 0;
        min-height: calc(100dvh - 5.25rem);
        gap: 0.5rem;
    }

    /* AI 会话无底栏：占满视口，composer sticky 贴底 */
    html[data-k-hide-tabbar] .k-chat {
        min-height: calc(100dvh - 1rem);
    }

    .k-chat__head {
        padding-inline: 0;
    }

    .k-chat__log {
        padding-bottom: 0.5rem;
    }

    .k-chat__empty-title {
        font-size: 1.25rem;
    }

    .k-chat__form {
        width: calc(100% + 2 * var(--k-page-edge, 17px));
        margin-left: calc(-1 * var(--k-page-edge, 17px));
        margin-right: calc(-1 * var(--k-page-edge, 17px));
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        padding: 0.625rem var(--k-page-edge, 17px);
        box-shadow: 0 -12px 32px rgb(0 0 0 / 28%);
    }

    .k-chat__form:focus-within {
        box-shadow: 0 -12px 32px rgb(0 0 0 / 28%), 0 0 0 1px rgb(var(--k-primary-rgb) / 18%);
    }
}


/* 对话空态 suggest：标签不是首页推荐，去掉播放三角 */
.k-chat .k-chips > a::before {
    content: none;
    display: none;
}

.k-chat__row button:hover {
    color: var(--k-text);
}

.k-chat__empty .k-chips > a {
    transition: border-color 0.12s ease, background 0.12s ease;
}


.k-chat .k-chips > a:active {
    transform: scale(0.97);
    background: rgb(var(--k-primary-rgb) / 16%);
}

.k-chat__empty .k-chips > a:hover {
    background: rgb(var(--k-primary-rgb) / 10%);
    border-color: rgb(var(--k-primary-rgb) / 36%);
    color: var(--k-primary);
}

.k-msg__bubble {
    transition: border-color 0.12s ease, background 0.12s ease;
}

.k-msg--ai .k-msg__bubble:hover {
    border-color: var(--k-interactive-border-hover);
}




.k-chat__form .k-ais__quota {
    margin-top: 0;
    margin-bottom: 0.25rem;
    padding: 8px 10px;
    background: rgb(255 255 255 / 3%);
}

.k-chat__form .k-composer__plus,
.k-chat__form .k-composer__send {
    flex: 0 0 auto;
}

.k-chat__form .k-composer__plus:hover {
    color: var(--k-text);
    background: rgb(var(--k-hover-rgb) / 72%);
    border-radius: 50%;
}



.k-chat__form[aria-busy="true"] {
    opacity: 0.78;
    pointer-events: none;
}

.k-chat__form[aria-busy="true"] .k-composer__send {
    filter: saturate(0.7);
}

.k-chat__form:focus-within {
    border-color: rgb(var(--k-primary-rgb) / 42%);
    box-shadow: 0 0 0 1px rgb(var(--k-primary-rgb) / 18%);
}

.k-chat__chip:hover,
.k-chat .k-chips > a:hover {
    border-color: var(--k-interactive-border-hover);
    color: var(--k-text);
}

/* ── AI 会话失效态（参照 ai-session：面板 768x378、内容居中）── */
.k-ses {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 768px;
    max-width: 100%;
    min-height: 378px;
    /* 参照实测 [464,80]：内容列起点 352 + 112（不用 auto 居中，那会落在 483） */
    margin: 32px 0 0 112px;
    padding: 40px 24px;
    border-radius: 12px;
    border: 1px solid var(--k-border-soft);
    background: var(--k-tint);
    text-align: center;
}

.k-ses__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgb(22 224 157 / 36%);
    color: var(--k-primary);
    font-size: 15px;
}

.k-ses__title {
    margin: 18px 0 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--k-text);
}

.k-ses__desc {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--k-text-subtle);
}

.k-ses__back {
    margin-top: 26px;
    height: 37px;
    padding: 0 22px;
    border-radius: 8px;
    font-size: 13px;
}

/* ── AI 消息操作行（任务 4.2）── */
.k-msg__ops {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    width: 100%;
    opacity: 0.72;
    transition: opacity 0.12s ease;
}

.k-msg:hover .k-msg__ops,
.k-msg:focus-within .k-msg__ops {
    opacity: 1;
}

.k-msg__retry:hover {
    background: var(--k-warning-bg);
    border-color: var(--k-warning);
}
.k-msg__op {
    border: 0;
    background: none;
    padding: 4px 8px;
    border-radius: 7px;
    color: var(--k-text-subtle);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.k-msg__op:hover {
    color: var(--k-text);
    background: rgb(var(--k-hover-rgb) / 60%);
}
.k-msg__op[aria-pressed="true"] {
    color: var(--k-primary);
}




/* ── 16:34 打磨：空态 / composer / ops 触感 ── */
.k-chat__empty-title {
    letter-spacing: 0.01em;
}

.k-chat__form .k-composer__send {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--k-primary);
    color: var(--k-primary-ink, #07140f);
    border: 0;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.k-chat__form .k-composer__send:hover {
    filter: brightness(1.08);
}

.k-chat__form .k-composer__send:active {
    transform: scale(0.94);
}

.k-chat__form .k-composer__plus {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--k-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

/* ops 常显（17:05：对照源站操作条；悬停再抬亮由文末规则负责） */
.k-msg__ops { opacity: 0.88; }
.k-msg:hover .k-msg__ops,
.k-msg:focus-within .k-msg__ops { opacity: 1; }

@media (hover: none) {
    .k-msg__ops { opacity: 0.95; }
}


/* ── 16:37 收工前补丁 ── */
.k-chat__empty .k-chips {
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 22rem;
}

.k-msg--error .k-msg__retry {
    min-height: 1.75rem;
    padding: 0.25rem 0.75rem;
}

.k-msg--error .k-msg__retry:active {
    transform: scale(0.97);
}

.k-chat__log:has(.k-msg) .k-chat__empty {
    display: none;
}


/* ── 17:05 修复：气泡体列布局（修移动端竖排字）── */
.k-msg__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    max-width: calc(100% - 2.25rem);
}

.k-msg--user .k-msg__body {
    align-items: flex-end;
}

.k-msg__bubble {
    max-width: 100%;
    min-width: 3rem;
}

/* ops 挂在 body 下：常显（对照源站会话操作条），悬停再抬亮 */
.k-msg__ops {
    opacity: 0.88;
    width: auto;
    max-width: 100%;
    flex-wrap: wrap;
    margin-top: 2px;
    gap: 2px;
}

.k-msg:hover .k-msg__ops,
.k-msg:focus-within .k-msg__ops {
    opacity: 1;
}

@media (hover: none) {
    .k-msg__ops { opacity: 0.95; }
}

.k-msg__op {
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.k-msg__op:hover {
    border-color: var(--k-border-soft);
}

.k-msg__op[aria-pressed="true"] {
    background: rgb(var(--k-primary-rgb) / 14%);
    border-color: rgb(var(--k-primary-rgb) / 28%);
}

/* 空态 suggest：加强 chip 轮廓（去掉播放三角后原先太像纯文字） */
.k-chat__empty .k-chips > a {
    padding: 0.4375rem 0.875rem;
    border-radius: 999px;
    border: 1px solid var(--k-interactive-border);
    background: rgb(255 255 255 / 4%);
    color: var(--k-text-muted);
    font-size: var(--k-fs-sm);
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.k-chat__empty .k-chips > a:hover,
.k-chat__empty .k-chips > a:focus-visible {
    color: var(--k-primary);
    border-color: rgb(var(--k-primary-rgb) / 42%);
    background: rgb(var(--k-primary-rgb) / 10%);
    outline: none;
}

.k-chat__empty .k-chips {
    gap: 0.625rem;
    max-width: 24rem;
    margin-top: 0.25rem;
}

/* 流式/发送态：发送钮脉冲 */
.k-chat__form[aria-busy="true"] .k-composer__send {
    animation: k-send-pulse 1.1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes k-send-pulse {
    0%, 100% { filter: brightness(1); box-shadow: 0 0 0 0 rgb(var(--k-primary-rgb) / 35%); }
    50% { filter: brightness(1.12); box-shadow: 0 0 0 6px rgb(var(--k-primary-rgb) / 0%); }
}

@media (prefers-reduced-motion: reduce) {
    .k-chat__form[aria-busy="true"] .k-composer__send { animation: none; }
}

/* typing 气泡最小宽度，避免空态塌成细条 */
.k-msg--typing .k-msg__bubble {
    min-width: 4.5rem;
    min-height: 2.5rem;
}

/* composer 桌面再压一档视觉 */
.k-chat__form {
    gap: 0.4375rem;
}

.k-chat__row {
    gap: 0.625rem;
}

.k-chat__input {
    font-size: 0.9375rem;
}

/* 移动：消息左右留白、气泡更饱满 */
@media (max-width: 1023.98px) {
    .k-msg {
        max-width: 92%;
    }

    .k-msg__body {
        max-width: calc(100% - 2rem);
    }

    .k-msg__bubble {
        font-size: 0.9375rem;
        line-height: 1.65;
        padding: 0.6875rem 0.875rem;
    }

    .k-msg__ops {
        opacity: 0.95;
        gap: 4px;
    }

    .k-msg__op {
        min-height: 32px;
        padding: 6px 12px;
        font-size: 12px;
        background: rgb(255 255 255 / 3%);
        border-color: var(--k-border-soft);
    }

    .k-chat__empty-title {
        font-size: 1.375rem;
        font-weight: 650;
        letter-spacing: 0.01em;
    }

    .k-chat__empty .k-chips > a {
        padding: 0.5rem 1rem;
        background: rgb(255 255 255 / 5%);
    }

    /* composer 与配额更紧凑 */
    .k-chat__form {
        padding-top: 0.5rem;
        padding-bottom: 0.625rem;
    }

    .k-chat__form .k-ais__quota {
        margin-bottom: 0.125rem;
    }
}

/* mic 占位（对照源站 composer 右侧麦克风） */
.k-chat__form .k-composer__mic {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--k-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}
.k-chat__form .k-composer__mic:hover {
    color: var(--k-text);
    background: rgb(var(--k-hover-rgb) / 72%);
}
.k-chat__form .k-composer__mic:active {
    transform: scale(0.94);
}

/* ── 对话内嵌结果卡（假流式 / 真响应 cards）── */
.k-msg__cards {
    width: 100%;
    max-width: 36rem;
    margin-top: 2px;
}

.k-msg__demo-note {
    margin: 0 0 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px dashed rgb(var(--k-primary-rgb) / 28%);
    background: rgb(var(--k-primary-rgb) / 6%);
    color: var(--k-text-subtle);
    font-size: 11px;
    line-height: 1.4;
}

.k-msg__ais-card {
    margin-top: 0;
    padding: 14px 14px 16px;
}

.k-msg__ais-card .k-ais__chips {
    margin-top: 12px;
}

.k-msg__filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 11px;
    border-radius: 14px;
    border: 1px solid var(--k-interactive-border);
    background: transparent;
    color: var(--k-text-muted);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

.k-msg__filter > i {
    font-style: normal;
    color: var(--k-text-subtle);
}

.k-msg__filter[aria-current="true"] {
    border-color: rgb(22 224 157 / 48%);
    background: rgb(22 224 157 / 12%);
    color: var(--k-primary);
    font-weight: 600;
}

.k-msg__filter[aria-current="true"] > i {
    color: var(--k-primary);
}

.k-msg__ais-card .k-ais__poster {
    flex: 0 0 88px;
    height: 118px;
}

.k-msg__ais-card .k-ais__info h3 {
    font-size: 14px;
}

.k-msg__ais-card .k-ais__play {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 15px;
    background: var(--k-primary);
    color: var(--k-primary-ink, #07140f);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.k-msg__ais-card .k-ais__play:hover {
    filter: brightness(1.06);
}

.k-msg__ais-card .k-ais__ops {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.k-msg--ai .k-msg__body {
    max-width: min(36rem, calc(100% - 2.25rem));
}

@media (max-width: 1023.98px) {
    .k-msg__cards {
        max-width: 100%;
    }

    .k-msg__ais-card {
        padding: 12px;
        border-radius: 10px;
    }

    .k-msg__ais-card .k-ais__poster {
        flex: 0 0 72px;
        height: 96px;
    }

    .k-msg__ais-card .k-ais__row {
        gap: 10px;
        padding: 8px;
    }

    .k-msg--ai .k-msg__body {
        max-width: calc(100% - 2rem);
    }
}


/* ========== AI 搜索页对话感（对照 mirror ai-search-submit） ========== */
/* 页内 runAisSearch 仍可能带 .k-msg__cards 壳：勿用 36rem 窄列，与 SSR details 同宽 */
.k-ais--chat .k-msg__cards {
    max-width: 100%;
    width: 100%;
    margin-top: 0.25rem;
}

.k-ais--chat .k-msg__ais-card.k-ais__card {
    width: 100%;
    box-sizing: border-box;
}

.k-ais--chat .k-ais__turn > .k-msg__body {
    max-width: 100%;
}

.k-ais--chat {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 3rem);
}

/* 勿 flex-grow 撑满视口：否则「结果不满意」与 composer 之间会出现大块空白 */
.k-ais--chat .k-ais__thread {
    flex: 0 1 auto;
}

.k-ais--chat .k-ais__dock {
    flex: 0 0 auto;
    margin-top: auto;
}

.k-ais__thread {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1 1 auto;
    padding: 0.75rem 0 1rem;
    max-width: 52rem;
    margin: 0 auto;
    width: 100%;
}

.k-ais--chat .k-msg {
    max-width: 100%;
}

.k-ais--chat .k-msg__body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 0;
    flex: 1;
}

/* mirror user bubble：深色描边，非主色实心 */
.k-ais--chat .k-msg--user .k-msg__bubble {
    background: var(--k-card);
    color: var(--k-text);
    border: 1px solid var(--k-interactive-border);
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 1px 0 rgb(0 0 0 / 18%);
}

.k-ais--chat .k-ais__turn {
    max-width: 100%;
    width: 100%;
}

.k-ais--chat .k-ais__status {
    margin: 0;
}

.k-ais--chat .k-ais__sum {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--k-text);
    font-weight: 400;
}

.k-ais--chat .k-ais__sum b {
    color: var(--k-primary);
    font-weight: 700;
}

.k-ais--chat .k-ais__card {
    margin-top: 0.25rem;
}

/* 结果卡：片单 + 播放 */
.k-ais__fav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 0;
    flex: 1;
    height: 1.75rem;
    padding: 0 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--k-interactive-border);
    background: transparent;
    color: var(--k-text-muted);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.k-ais__fav:hover {
    border-color: rgb(var(--k-primary-rgb) / 34%);
    color: var(--k-text);
    background: rgb(255 255 255 / 4%);
}

.k-ais__ops {
    gap: 0.5rem;
}

.k-ais__ops .k-ais__play {
    flex: 1;
    text-decoration: none;
    justify-content: center;
}

.k-msg__ais-card .k-ais__fav {
    height: 2rem;
}

@media (max-width: 720px) {
    .k-ais__thread {
        padding-inline: 0.25rem;
    }
    .k-ais--chat .k-msg--user {
        max-width: 86%;
        margin-left: auto;
    }
}


/* ========== AIS visual polish (executor, non-destructive) ========== */
/* 对照 mirror ai-search-submit：用户气泡不竖排、AI 方标、片单/播放等高、composer 触感 */

/* 用户气泡：fit-content，避免 min-width:3rem 把两字挤成竖排 */
.k-ais--chat .k-msg--user {
    max-width: 82%;
    width: fit-content;
    margin-left: auto;
    align-self: flex-end;
}

.k-ais--chat .k-msg--user .k-msg__body {
    flex: 0 1 auto;
    max-width: 100%;
    align-items: flex-end;
}

.k-ais--chat .k-msg--user .k-msg__bubble {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    border-bottom-right-radius: 0.25rem;
    background: var(--k-primary);
    border: 1px solid rgb(var(--k-primary-rgb) / 28%);
    color: var(--k-primary-ink, #07140f);
    font-size: 0.9375rem; /* 15px mirror */
    line-height: 1.5;
    white-space: pre-wrap;
    box-shadow: 0 1px 0 rgb(0 0 0 / 12%), 0 6px 18px rgb(0 0 0 / 8%);
}

/* AI 品牌方标（mirror movie-brand-mark：方圆角 + 描边，非正圆） */
.k-ais--chat .k-ais__turn > .k-msg__avatar,
.k-ais--chat .k-msg--ai > .k-msg__avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgb(22 224 157 / 28%);
    background: rgb(22 224 157 / 10%);
    color: var(--k-primary);
    font-size: 0;
    line-height: 0;
    box-shadow: inset 0 0 0 1px rgb(22 224 157 / 8%);
}

.k-ais--chat .k-ais__turn > .k-msg__avatar::before,
.k-ais--chat .k-msg--ai > .k-msg__avatar::before {
    content: none;
}
.k-ais--chat .k-msg__avatar--tv,
.k-ais--chat .k-msg__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.k-ais--chat .k-msg__avatar--tv svg {
    display: block;
    color: var(--k-primary);
}

/* 状态胶囊：略紧凑 */
.k-ais--chat .k-ais__state {
    height: 1.75rem;
    padding: 0 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.375rem;
}

.k-ais--chat .k-ais__sum {
    font-size: 0.9375rem;
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* 结果卡双按钮：等高、等分，对齐源站 h-8 */
.k-ais--chat .k-ais__ops,
.k-msg__ais-card .k-ais__ops {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.k-ais--chat .k-ais__fav,
.k-msg__ais-card .k-ais__fav {
    flex: 1 1 0;
    height: 2rem;
    min-height: 2rem;
    border-radius: 0.375rem;
    border: 1px solid var(--k-interactive-border);
    background: rgb(255 255 255 / 3%);
    color: var(--k-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.k-ais--chat .k-ais__fav:hover,
.k-msg__ais-card .k-ais__fav:hover {
    border-color: rgb(165 243 252 / 34%);
    color: var(--k-text);
    background: rgb(255 255 255 / 5%);
}

.k-ais--chat .k-ais__fav:active,
.k-msg__ais-card .k-ais__fav:active {
    transform: scale(0.98);
}

.k-ais--chat .k-ais__ops .k-ais__play,
.k-msg__ais-card .k-ais__ops .k-ais__play {
    flex: 1 1 0;
    height: 2rem;
    min-height: 2rem;
    padding: 0 0.875rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 1px 0 rgb(0 0 0 / 18%);
}

.k-ais--chat .k-ais__ops .k-ais__play:hover,
.k-msg__ais-card .k-ais__ops .k-ais__play:hover {
    filter: brightness(1.07);
}

.k-ais--chat .k-ais__ops .k-ais__play:active,
.k-msg__ais-card .k-ais__ops .k-ais__play:active {
    transform: scale(0.98);
}

/* 结果行微抬 */
.k-ais--chat .k-ais__row {
    transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.k-ais--chat .k-ais__row:hover {
    box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
}

/* composer ± / mic / 发送触感（AIS dock） */
.k-ais--chat .k-ais__composer .k-composer__plus,
.k-ais--chat .k-ais__composer .k-composer__mic {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgb(var(--k-hover-rgb) / 55%);
    color: var(--k-text-muted);
    transition: color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.k-ais--chat .k-ais__composer .k-composer__plus:hover,
.k-ais--chat .k-ais__composer .k-composer__mic:hover {
    color: var(--k-text);
    background: rgb(var(--k-hover-rgb) / 72%);
}

.k-ais--chat .k-ais__composer .k-composer__plus:active,
.k-ais--chat .k-ais__composer .k-composer__mic:active {
    transform: scale(0.94);
}

.k-ais--chat .k-ais__composer .k-composer__send {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgb(var(--k-primary-rgb) / 0%);
    transition: filter 0.12s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.k-ais--chat .k-ais__composer .k-composer__send:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 0 4px rgb(var(--k-primary-rgb) / 18%);
}

.k-ais--chat .k-ais__composer .k-composer__send:active {
    transform: scale(0.92);
}

/* chat 页用户气泡：主色底 + primary-ink（浅/深主题均可读） */
.k-chat .k-msg--user .k-msg__bubble {
    background: var(--k-primary);
    color: var(--k-primary-ink, #07140f);
    border: 1px solid rgb(var(--k-primary-rgb) / 28%);
    border-bottom-right-radius: 0.25rem;
    box-shadow: 0 1px 0 rgb(0 0 0 / 12%);
}

.k-chat .k-msg--ai > .k-msg__avatar {
    border-radius: 0.375rem;
    border: 1px solid rgb(22 224 157 / 28%);
    background: rgb(22 224 157 / 10%);
    font-size: 0;
}

.k-chat .k-msg--ai > .k-msg__avatar::before {
    content: none;
}

.k-chat .k-msg--user > .k-msg__avatar {
    display: none; /* mirror 用户侧无头像 */
}

/* /ai-chat 搜片结果：与 /ai-search（.k-ais--chat）同宽同回合结构 */
.k-chat .k-msg--ai.k-ais__turn {
    max-width: 100%;
    width: 100%;
}

.k-chat .k-msg--ai.k-ais__turn > .k-msg__body {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.k-chat .k-ais__turn .k-msg__cards {
    max-width: 100%;
    width: 100%;
    margin-top: 0.25rem;
}

.k-chat .k-ais__turn .k-msg__ais-card.k-ais__card {
    width: 100%;
    box-sizing: border-box;
}

.k-chat .k-ais__turn .k-ais__status,
.k-chat .k-ais__turn .k-ais__sum {
    margin: 0;
}

.k-chat .k-ais__turn .k-ais__sum {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--k-text);
    font-weight: 400;
}

.k-chat .k-ais__turn .k-ais__sum b {
    color: var(--k-primary);
    font-weight: 600;
}

/* /ai-chat 落地页（.k-chat）：无底栏时锁视口高度，消息区 .k-chat__log 内滚 */
html[data-k-hide-tabbar] #k-main:has(#app-main > .k-chat[data-k-chat]) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

html[data-k-hide-tabbar] #app-main:has(> .k-chat[data-k-chat]) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
}

html[data-k-hide-tabbar] #app-main:has(> .k-chat[data-k-chat]) > .k-chat {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
}

/* /ai-chat 会话：与 /ai-search 同壳 — thread 内滚动、dock 贴底、宽屏结果三列 */
html[data-k-hide-tabbar] #app-main:has(.k-ais--chat[data-k-chat]) {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 0.25rem);
    max-height: 100dvh;
    overflow: hidden;
    padding-bottom: 0;
}

.k-ais--chat[data-k-chat] {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    gap: 0;
    padding-top: 0;
}

.k-ais--chat[data-k-chat] .k-ais__page-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0.75rem 0 0;
}

@media (min-width: 768px) {
    .k-ais--chat[data-k-chat] .k-ais__page-body {
        padding: 1.25rem 1.5rem 0;
    }
}

.k-ais--chat[data-k-chat] .k-ais__page-body--center {
    align-items: center;
    justify-content: center;
    padding-bottom: 2rem;
}

.k-ais--chat[data-k-chat] .k-ais__page-body .k-ais__thread.k-chat__log {
    flex: 1 1 auto;
    min-height: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 1rem;
}

.k-ais--chat[data-k-chat] .k-ais__dock {
    flex: 0 0 auto;
    max-width: 68rem;
    width: 100%;
    margin: 0 auto;
}

.k-ais--chat[data-k-chat] .k-msg--user .k-msg__bubble {
    background: var(--k-card);
    color: var(--k-text);
    border: 1px solid var(--k-interactive-border);
    box-shadow: 0 1px 0 rgb(0 0 0 / 18%);
}

@media (max-width: 1023.98px) {
    .k-ais--chat[data-k-chat] {
        width: calc(100% + 2 * var(--k-page-edge, 17px));
        margin-left: calc(-1 * var(--k-page-edge, 17px));
        margin-right: calc(-1 * var(--k-page-edge, 17px));
        padding-left: var(--k-page-edge, 17px);
        padding-right: var(--k-page-edge, 17px);
    }

    .k-ais--chat[data-k-chat] .k-ais__page-body .k-ais__thread.k-chat__log {
        padding-bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
    }

    .k-ais--chat[data-k-chat] .k-ais__dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: env(safe-area-inset-bottom, 0px);
        z-index: 25;
        max-width: none;
        margin: 0;
        padding-left: var(--k-page-edge, 17px);
        padding-right: var(--k-page-edge, 17px);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .k-ais--chat[data-k-chat] .k-ais__dock .k-chat__form {
        width: 100%;
        margin: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}


/* ========== Grok CSS: 竖排斩断 + 结果卡密度 + chips/composer (17:34) ========== */
/*
  根因：.k-msg__bubble 的 min-width:3rem + overflow-wrap:break-word，
  在 flex 收缩时让 CJK 逐字换行 → 短句竖排。
  斩断：覆盖 min-width / overflow-wrap；用户气泡 max-content + keep-all。
  覆盖 .k-chat 与 .k-ais--chat（twig 已把用户气泡直接挂在 .k-msg 下）。
*/

/* —— 竖排斩断（通用用户气泡） —— */
.k-msg--user {
    width: max-content;
    max-width: min(88%, 36rem);
    min-width: 0;
    flex-shrink: 0;
}

.k-msg--user .k-msg__bubble,
.k-msg--user .k-msg__bubble[data-k-msg-text] {
    width: max-content;
    max-width: 100%;
    min-width: 0;                 /* 覆盖 min-width: 3rem */
    overflow-wrap: normal;        /* 覆盖 overflow-wrap: break-word */
    word-break: keep-all;         /* CJK 不逐字断 */
    white-space: pre-wrap;
    box-sizing: border-box;
}

/* chat 页：用户气泡（深色样式之上补尺寸斩断） */
.k-chat .k-msg--user {
    width: max-content;
    max-width: min(88%, 36rem);
    margin-left: auto;
    align-self: flex-end;
}

.k-chat .k-msg--user .k-msg__bubble {
    width: max-content;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: normal;
    word-break: keep-all;
    padding: 0.5rem 0.875rem;
    line-height: 1.5;
}

/* AIS 结果页：强化已有 fit-content，补 keep-all / overflow-wrap */
.k-ais--chat .k-msg--user {
    width: max-content;
    max-width: min(82%, 36rem);
}

.k-ais--chat .k-msg--user .k-msg__bubble {
    width: max-content;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: normal;
    word-break: keep-all;
}

/* AI 气泡正文仍可断行，但优先 keep-all，避免无意义单字竖条 */
.k-msg--ai .k-msg__bubble {
    overflow-wrap: anywhere;
    word-break: keep-all;
}

/* typing 态保留最小占位，但不强制 3rem 竖排风险 */
.k-msg--typing .k-msg__bubble {
    min-width: 4.5rem;
    width: auto;
}

/* —— 结果卡密度（对话内嵌 + AIS） —— */
.k-msg__ais-card,
.k-ais--chat .k-ais__card {
    padding: 12px 14px 14px;
    margin-top: 0.25rem;
}

.k-msg__ais-card .k-ais__chips,
.k-ais--chat .k-ais__chips {
    gap: 6px;
    margin-top: 10px;
}

.k-msg__ais-card .k-ais__chips > a,
.k-msg__ais-card .k-ais__chips > button,
.k-msg__filter,
.k-ais--chat .k-ais__chips > a,
.k-ais--chat .k-ais__chips > button {
    height: 26px;
    padding: 0 10px;
    font-size: 11.5px;
    border-radius: 13px;
}
.k-ais--chat details.k-ais__card > summary.k-ais__cardhead {
    list-style: none;
}
.k-ais--chat details.k-ais__card > summary.k-ais__cardhead::-webkit-details-marker {
    display: none;
}

.k-msg__ais-card .k-ais__sub,
.k-ais--chat .k-ais__sub {
    margin-top: 10px;
    font-size: 12.5px;
}

.k-msg__ais-card .k-ais__rows,
.k-ais--chat .k-ais__rows {
    gap: 8px;
    margin-top: 8px;
}

.k-msg__ais-card .k-ais__row,
.k-ais--chat .k-ais__row {
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
}

.k-msg__ais-card .k-ais__poster {
    flex: 0 0 76px;
    height: 102px;
    border-radius: 6px;
}

.k-ais--chat .k-ais__poster {
    flex: 0 0 108px;
    height: 144px;
}

.k-msg__ais-card .k-ais__info,
.k-ais--chat .k-ais__info {
    gap: 5px;
}

.k-msg__ais-card .k-ais__info h3,
.k-ais--chat .k-ais__info h3 {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.35;
}

.k-msg__ais-card .k-ais__meta,
.k-ais--chat .k-ais__meta {
    font-size: 11.5px;
}

.k-msg__ais-card .k-ais__tags,
.k-ais--chat .k-ais__tags {
    gap: 4px;
}

.k-msg__ais-card .k-ais__tags span,
.k-ais--chat .k-ais__tags span {
    height: 20px;
    padding: 0 7px;
    font-size: 10.5px;
    line-height: 20px;
}

.k-msg__ais-card .k-ais__ops,
.k-ais--chat .k-ais__ops {
    gap: 0.5rem;
    margin-top: 0.375rem;
}

.k-msg__ais-card .k-ais__ops .k-ais__play,
.k-msg__ais-card .k-ais__fav,
.k-ais--chat .k-ais__ops .k-ais__play,
.k-ais--chat .k-ais__fav {
    height: 1.875rem;
    min-height: 1.875rem;
    font-size: 0.75rem;
}

/* —— composer / dock 再压一档 —— */
.k-chat__form {
    gap: 0.375rem;
    padding: 0.5625rem 0.75rem;
}

.k-chat__form .k-ais__quota {
    padding: 6px 10px;
    gap: 8px;
    margin-bottom: 0;
}

.k-chat__chip {
    padding: 0.1rem 0.45rem;
    font-size: 0.6875rem;
}

.k-chat__row {
    gap: 0.5rem;
}

.k-chat__input {
    font-size: 0.9375rem;
    padding: 0.4375rem 0.25rem;
}

.k-ais--chat .k-ais__dock {
    padding: 8px 0 10px;
    margin-top: 14px;
}

.k-ais--chat .k-ais__dock .k-ais__quota {
    padding: 7px 10px;
    gap: 8px;
}

.k-ais--chat .k-ais__dock .k-ais__composer {
    margin-top: 6px;
}

@media (max-width: 1023.98px) {
    .k-msg--user,
    .k-chat .k-msg--user,
    .k-ais--chat .k-msg--user {
        max-width: min(92%, 100%);
    }

    .k-msg__ais-card,
    .k-ais--chat .k-ais__card {
        padding: 10px;
        border-radius: 10px;
    }

    .k-msg__ais-card .k-ais__poster {
        flex: 0 0 64px;
        height: 86px;
    }

    .k-ais--chat .k-ais__poster {
        flex: 0 0 84px;
        height: 112px;
    }

    .k-chat__form {
        padding-top: 0.4375rem;
        padding-bottom: 0.5rem;
    }

    .k-chat__form .k-ais__quota {
        padding: 5px 8px;
    }
}

/* ========== UI scan 2026-10-11: AIS 双列 + 加宽 ========== */
/* mirror: grid gap-2.5 sm:grid-cols-2 2xl:grid-cols-3 */
.k-ais--chat .k-ais__thread {
    max-width: 68rem;
}

.k-ais--chat .k-msg--ai,
.k-ais--chat .k-ais__turn {
    width: 100%;
    max-width: 100%;
}

.k-ais--chat .k-msg--ai > .k-msg__body,
.k-ais--chat .k-ais__turn > .k-msg__body {
    max-width: 100%;
    width: 100%;
    flex: 1 1 auto;
}

.k-ais--chat .k-ais__rows {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 10px;
}

@media (min-width: 900px) {
    .k-ais--chat .k-ais__rows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1500px) {
    .k-ais--chat .k-ais__rows {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.k-ais--chat .k-ais__row {
    min-width: 0;
    height: auto;
}

.k-ais--chat .k-ais__poster {
    flex: 0 0 96px;
    height: 128px;
}

@media (min-width: 900px) {
    .k-ais--chat .k-ais__poster {
        flex: 0 0 108px;
        height: 144px;
    }
}

/* ── ais-poster-polish 2026-10-11 ── */
/* 保留 .k-ais__rows 双列/三列；只抛光海报 2:3 与卡内间距 */
.k-ais--chat .k-ais__row {
    align-items: stretch;
    gap: 12px;
    padding: 10px;
}
.k-ais--chat .k-ais__poster {
    flex: 0 0 90px;
    width: 90px;
    height: 135px; /* 2:3 */
    border-radius: 8px;
    overflow: hidden;
}
.k-ais--chat .k-ais__poster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
@media (min-width: 900px) {
    .k-ais--chat .k-ais__poster {
        flex: 0 0 108px;
        width: 108px;
        height: 162px;
    }
}
.k-ais--chat .k-ais__ops {
    margin-top: auto;
    gap: 8px;
}
.k-ais--chat .k-ais__ops .k-ais__play,
.k-ais--chat .k-ais__fav {
    height: 32px;
    min-height: 32px;
    border-radius: 8px;
}

/* ── ais-session-chrome 2026-10-11 ── */
/* 顶栏对照源站 session：返回带边框+底 / 回首页 / 新对话；不改双列·气泡·80rem·page-edge */

.k-ais__bar,
.k-chat__head.k-ais__bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.25rem;
}

.k-ais__bar-left {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    z-index: 1;
}

.k-ais__bar .k-page__bar-title {
    position: static;
    left: auto;
    transform: none;
    justify-self: center;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.k-chat__head.k-ais__bar .k-chat__head-text {
    justify-self: center;
    text-align: center;
}

/* 覆盖 blocks.css 裸箭头：AI 页返回 = movie-button-secondary */
.k-ais__bar .k-ais__ctrl,
.k-ais__bar .k-page__back.k-ais__back,
.k-ais__bar .k-ais__home,
.k-ais__bar .k-ais__edit,
.k-chat__head.k-ais__bar .k-ais__ctrl {
    position: static;
    top: auto;
    right: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    box-sizing: border-box;
    min-width: 2.5rem;
    min-height: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 0.5rem;
    border: 1px solid var(--k-border, rgba(255,255,255,.12));
    background: var(--k-surface, #25262b);
    color: var(--k-text-muted, #9aa3b2);
    text-decoration: none;
    box-shadow: 0 1px 2px rgb(0 0 0 / 18%);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    line-height: 0;
}

.k-ais__bar .k-ais__home {
    width: auto;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    color: var(--k-text, #e8eaed);
}

.k-ais__bar .k-ais__home-label {
    white-space: nowrap;
}

@media (max-width: 520px) {
    .k-ais__bar .k-ais__home-label { display: none; }
    .k-ais__bar .k-ais__home {
        width: 2.5rem;
        padding: 0;
    }
}

.k-ais__bar .k-ais__ctrl:hover,
.k-ais__bar .k-page__back.k-ais__back:hover,
.k-ais__bar .k-ais__home:hover,
.k-ais__bar .k-ais__edit:hover {
    color: var(--k-text);
    border-color: var(--k-interactive-border-hover, rgba(255,255,255,.22));
    background: color-mix(in srgb, var(--k-primary, #16e09d) 8%, var(--k-surface, #25262b));
}

.k-ais__bar .k-ais__ctrl svg,
.k-ais__bar .k-ais__back svg,
.k-ais__bar .k-ais__home svg,
.k-ais__bar .k-ais__edit svg {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

/* ── 完成态 pill：挑好了 / 这组已挑好 + TV ── */
.k-ais--chat .k-ais__status,
.k-ais__status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0;
}

.k-ais__state-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(var(--k-primary-rgb, 22 224 157) / 36%);
    background: rgb(var(--k-primary-rgb, 22 224 157) / 10%);
    color: var(--k-primary, #16e09d);
}

.k-ais__state-play {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 999px;
    background: var(--k-primary, #16e09d);
    color: var(--k-primary-ink, #07140f);
    box-shadow: 0 0 0 2px var(--k-bg, #111214);
}

.k-ais__state-play svg { width: 0.5rem; height: 0.5rem; }

.k-ais--chat .k-ais__state,
.k-ais__state {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 1.875rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid rgb(var(--k-primary-rgb, 22 224 157) / 36%);
    background: rgb(var(--k-primary-rgb, 22 224 157) / 10%);
    color: var(--k-primary, #16e09d);
    font-size: 0.8125rem;
    font-weight: 600;
}

.k-ais__state-sub {
    /* 旁接灰文，不是第二个 pill */
    display: inline;
    height: auto;
    padding: 0;
    margin-left: 0.35rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--k-text-muted, #9aa3b2);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── 详情侧栏 .k-ais-drawer（对照源站 movie-preview-drawer）── */
.k-ais-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

.k-ais-drawer:not([hidden]) {
    pointer-events: auto;
}

.k-ais-drawer[hidden] {
    display: none !important;
}

.k-ais-drawer__mask {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgb(0 0 0 / 48%);
    cursor: pointer;
}

.k-ais-drawer__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: var(--k-bg, #111214);
    color: var(--k-text);
    box-shadow: -12px 0 40px rgb(0 0 0 / 35%);
    transform: translateX(0);
    animation: k-ais-drawer-in 0.22s ease;
}

@keyframes k-ais-drawer-in {
    from { transform: translateX(100%); opacity: 0.7; }
    to { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .k-ais-drawer__panel { animation: none; }
}

@media (min-width: 768px) {
    .k-ais-drawer__panel {
        width: min(42rem, 58vw);
        margin: 0.75rem 0.75rem 0.75rem 0;
        height: calc(100dvh - 0.75rem);
        max-height: calc(100dvh - 0.75rem);
        border-radius: 0.625rem 0 0 0.625rem;
        border: 1px solid var(--k-border-soft, rgba(255,255,255,.1));
        border-right: 0;
    }
}

.k-ais-drawer__atmosphere {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 0.85;
}

.k-ais-drawer__atmosphere-img {
    position: absolute;
    inset: -2.5rem;
    width: calc(100% + 5rem);
    height: calc(100% + 5rem);
    object-fit: cover;
    opacity: 0.2;
    filter: blur(36px) saturate(1.5);
    transform: scale(1.1);
}

.k-ais-drawer__atmosphere-shield {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(0 0 0 / 20%), var(--k-bg, #111214) 72%);
}

.k-ais-drawer__atmosphere-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 28% 12%, rgb(var(--k-primary-rgb, 22 224 157) / 18%), transparent 34%),
        radial-gradient(circle at 78% 20%, rgb(56 189 248 / 12%), transparent 30%);
}

.k-ais-drawer__head,
.k-ais-drawer__body,
.k-ais-drawer__foot {
    position: relative;
    z-index: 1;
}

.k-ais-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--k-border-soft, rgba(255,255,255,.1));
}

.k-ais-drawer__titles {
    min-width: 0;
}

.k-ais-drawer__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--k-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .k-ais-drawer__title { font-size: 1.125rem; }
}

.k-ais-drawer__meta {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--k-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.k-ais-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--k-border, rgba(255,255,255,.12));
    background: var(--k-surface, #25262b);
    color: var(--k-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.k-ais-drawer__close:hover {
    color: var(--k-text);
    border-color: var(--k-interactive-border-hover, rgba(255,255,255,.22));
}

.k-ais-drawer__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: none;
}
.k-ais-drawer__body::-webkit-scrollbar { display: none; }

.k-ais-drawer__hero {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .k-ais-drawer__hero {
        grid-template-columns: 12rem minmax(0, 1fr);
        align-items: stretch;
    }
}

.k-ais-drawer__poster {
    position: relative;
    aspect-ratio: var(--k-cover-ratio);
    width: 100%;
    max-width: 12rem;
    min-width: 7.5rem;
    min-height: 11rem;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid var(--k-border, rgba(255,255,255,.12));
    background: var(--k-surface, #25262b);
    box-shadow: 0 4px 16px rgb(0 0 0 / 30%);
    flex: 0 0 auto;
}

@media (min-width: 768px) {
    .k-ais-drawer__poster {
        margin-inline: 0;
        width: 12rem;
        max-width: 12rem;
        /* 保持 2:3，避免 height:100% + aspect-ratio:auto 变成细条 */
        aspect-ratio: var(--k-cover-ratio);
        height: auto;
        min-height: 0;
        align-self: start;
    }
}

.k-ais-drawer__poster.is-empty {
    background:
        linear-gradient(145deg, rgb(255 255 255 / 6%), transparent 55%),
        var(--k-surface, #25262b);
}

.k-ais-drawer__poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.k-ais-drawer__poster img:not([src]),
.k-ais-drawer__poster img[src=""] {
    visibility: hidden;
}

.k-ais-drawer__hero-main {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.k-ais-drawer__seasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.k-ais-drawer__seasons > button {
    appearance: none;
    flex: 0 0 auto;
    height: 2rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--k-border, rgba(255,255,255,.12));
    background: var(--k-surface, #25262b);
    color: var(--k-text-muted);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
}

.k-ais-drawer__seasons > button.is-active {
    border-color: rgb(var(--k-primary-rgb, 22 224 157) / 55%);
    background: rgb(var(--k-primary-rgb, 22 224 157) / 14%);
    color: var(--k-primary, #16e09d);
    font-weight: 600;
}

.k-ais-drawer__seasons > button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.k-ais-drawer__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.k-ais-drawer__tags > span,
.k-ais-drawer__tag {
    display: inline-flex;
    max-width: 100%;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--k-border-soft, rgba(255,255,255,.1));
    background: rgb(255 255 255 / 3%);
    color: var(--k-text-muted);
    font-size: 0.75rem;
    line-height: 1.35;
    word-break: break-word;
}

.k-ais-drawer__sec {
    margin-top: 1.25rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--k-border-soft, rgba(255,255,255,.1));
    background: rgb(255 255 255 / 2%);
}

.k-ais-drawer__sec > h3 {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--k-text);
}

.k-ais-drawer__sec > p,
.k-ais-drawer__empty {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--k-text-muted);
}

.k-ais-drawer__eps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(6.75rem, 100%), 1fr));
    gap: 0.5rem;
    max-height: 16rem;
    overflow-y: auto;
    scrollbar-width: none;
}
.k-ais-drawer__eps::-webkit-scrollbar { display: none; }

.k-ais-drawer__eps > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--k-border, rgba(255,255,255,.12));
    background: var(--k-surface, #25262b);
    color: var(--k-text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
}

.k-ais-drawer__eps > a.is-active,
.k-ais-drawer__eps > a:hover {
    border-color: rgb(var(--k-primary-rgb, 22 224 157) / 45%);
    color: var(--k-primary, #16e09d);
}

.k-ais-drawer__foot {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--k-border-soft, rgba(255,255,255,.1));
}

.k-ais-drawer__fav,
.k-ais-drawer__play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 1 1 0;
    height: 2.75rem;
    border-radius: 0.5rem;
    border: 1px solid var(--k-border, rgba(255,255,255,.12));
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.12s ease, background 0.12s ease;
}

.k-ais-drawer__fav {
    background: var(--k-surface, #25262b);
    color: var(--k-text-muted);
}

.k-ais-drawer__fav:hover {
    color: var(--k-text);
    border-color: var(--k-interactive-border-hover, rgba(255,255,255,.22));
}

.k-ais-drawer__play {
    border-color: transparent;
    background: var(--k-primary, #16e09d);
    color: var(--k-primary-ink, #07140f);
}

.k-ais-drawer__play:hover { filter: brightness(1.06); }

body[data-k-ais-drawer-open] { overflow: hidden; }

/* ⓘ 结果卡详情钮微调 */
.k-ais__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--k-text-muted);
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}
.k-ais__more:hover { color: var(--k-primary, #16e09d); }

/* ── ais-ais-batch 2026-10-11 executor ── */
/* 顶栏：返回边框底 + 回首页 */
.k-ais--chat .k-ais__bar,
.k-chat .k-chat__head {
    gap: 0.5rem;
}
.k-ais--chat .k-ais__bar-left,
.k-chat__head-left {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}
.k-ais--chat .k-ais__back,
.k-ais--chat .k-page__back.k-ais__back,
.k-chat__head a.k-page__back,
.k-chat__head .k-ais__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--k-interactive-border, rgb(255 255 255 / 14%));
    background: rgb(255 255 255 / 4%);
    color: var(--k-text);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1;
    transition: border-color 0.12s ease, background 0.12s ease;
}
.k-ais--chat .k-ais__back:hover,
.k-chat__head a.k-page__back:hover,
.k-chat__head .k-ais__back:hover {
    border-color: var(--k-interactive-border-hover, rgb(255 255 255 / 28%));
    background: rgb(255 255 255 / 8%);
    color: var(--k-text);
}
.k-ais--chat .k-ais__home,
.k-chat__head .k-ais__home {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--k-interactive-border, rgb(255 255 255 / 14%));
    background: rgb(255 255 255 / 4%);
    color: var(--k-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.k-ais--chat .k-ais__home:hover,
.k-chat__head .k-ais__home:hover {
    color: var(--k-text);
    border-color: var(--k-interactive-border-hover, rgb(255 255 255 / 28%));
}

/* 挑好了状态 */
.k-ais--chat .k-ais__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0;
}
.k-ais--chat .k-ais__state-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    background: rgb(22 224 157 / 16%);
    color: rgb(22 224 157);
    flex: 0 0 auto;
}
.k-ais--chat .k-ais__state-play {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0.25rem;
    background: rgb(22 224 157);
    color: #04140f;
}
.k-ais--chat .k-ais__state-play svg { display: block; }
.k-ais--chat .k-ais__state {
    display: inline-flex;
    align-items: center;
    height: 1.75rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    border: 1px solid rgb(22 224 157 / 42%);
    background: rgb(22 224 157 / 12%);
    color: rgb(22 224 157);
    font-size: 12px;
    font-weight: 700;
}
.k-ais--chat .k-ais__state-sub {
    font-size: 12px;
    color: var(--k-text-subtle, #8b93a7);
    font-weight: 500;
}

/* details 收起：隐藏默认三角，sync 可点 */
.k-ais--chat details.k-ais__card > summary.k-ais__cardhead {
    list-style: none;
    cursor: pointer;
}
.k-ais--chat details.k-ais__card > summary.k-ais__cardhead::-webkit-details-marker { display: none; }
.k-ais--chat .k-ais__sync {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: var(--k-text-subtle);
}
.k-ais--chat .k-ais__sync-toggle {
    color: var(--k-primary, rgb(22 224 157));
    font-weight: 600;
}

/* chips 支持 button */
.k-ais--chat .k-ais__chips > button,
.k-ais--chat .k-ais__chips > .k-ais__chip,
.k-msg__ais-card .k-ais__chips > button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 11px;
    border-radius: 14px;
    border: 1px solid var(--k-interactive-border);
    background: transparent;
    color: var(--k-text-muted);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}
.k-ais--chat .k-ais__chips > button > i,
.k-ais--chat .k-ais__chips > .k-ais__chip > i {
    font-style: normal;
    color: var(--k-text-subtle);
}
.k-ais--chat .k-ais__chips > button[aria-current="true"],
.k-ais--chat .k-ais__chips > button.is-active,
.k-ais--chat .k-ais__chips > .k-ais__chip.is-active {
    border-color: rgb(22 224 157 / 48%);
    background: rgb(22 224 157 / 12%);
    color: var(--k-primary);
    font-weight: 600;
}
.k-ais--chat .k-ais__chips > button[aria-current="true"] > i,
.k-ais--chat .k-ais__chips > button.is-active > i {
    color: var(--k-primary);
}

/* 详情侧栏 */
.k-ais-drawer[hidden] { display: none !important; }
.k-ais-drawer {
    position: fixed;
    inset: 0;
    z-index: 80;
}
.k-ais-drawer__mask {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 48%);
}
.k-ais-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(22.5rem, 92vw);
    height: 100%;
    background: var(--k-surface, #12141a);
    border-left: 1px solid var(--k-border-soft);
    box-shadow: -12px 0 40px rgb(0 0 0 / 35%);
}
.k-ais-drawer__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--k-border-soft);
}
.k-ais-drawer__titles { flex: 1; min-width: 0; }
.k-ais-drawer__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--k-text);
    line-height: 1.35;
}
.k-ais-drawer__meta {
    margin: 0.25rem 0 0;
    font-size: 12px;
    color: var(--k-text-muted);
}
.k-ais-drawer__close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--k-interactive-border);
    background: transparent;
    color: var(--k-text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.k-ais-drawer__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.875rem 1rem 1rem;
}
.k-ais-drawer__hero {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}
.k-ais-drawer__poster {
    flex: 0 0 5.5rem;
    width: 5.5rem;
    height: 8.25rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgb(255 255 255 / 4%);
}
.k-ais-drawer__poster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.k-ais-drawer__hero-main { flex: 1; min-width: 0; }
.k-ais-drawer__seasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}
.k-ais-drawer__seasons > button {
    height: 1.75rem;
    padding: 0 0.65rem;
    border-radius: 0.4rem;
    border: 1px solid var(--k-interactive-border);
    background: transparent;
    color: var(--k-text-muted);
    font-size: 12px;
    cursor: pointer;
}
.k-ais-drawer__seasons > button.is-active {
    border-color: rgb(22 224 157 / 48%);
    background: rgb(22 224 157 / 12%);
    color: var(--k-primary);
    font-weight: 600;
}
.k-ais-drawer__seasons > button:disabled { opacity: 0.45; cursor: not-allowed; }
.k-ais-drawer__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.k-ais-drawer__tags > span {
    height: 1.35rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--k-border-soft);
    font-size: 11px;
    color: var(--k-text-muted);
    line-height: 1.35rem;
}
.k-ais-drawer__sec { margin-top: 0.875rem; }
.k-ais-drawer__sec > h3 {
    margin: 0 0 0.35rem;
    font-size: 12px;
    font-weight: 700;
    color: var(--k-text-subtle);
}
.k-ais-drawer__sec > p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--k-text);
}
.k-ais-drawer__empty { color: var(--k-text-subtle) !important; }
.k-ais-drawer__eps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.k-ais-drawer__eps > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.4rem;
    border-radius: 0.4rem;
    border: 1px solid var(--k-interactive-border);
    color: var(--k-text-muted);
    text-decoration: none;
    font-size: 12px;
}
.k-ais-drawer__eps > a.is-active {
    border-color: rgb(22 224 157 / 48%);
    background: rgb(22 224 157 / 12%);
    color: var(--k-primary);
    font-weight: 700;
}
.k-ais-drawer__foot {
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--k-border-soft);
}
.k-ais-drawer__play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: var(--k-primary, rgb(22 224 157));
    color: #04140f;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
}
html[data-k-ais-drawer-open] { overflow: hidden; }

/* details 收起：.k-ais__rows 的 display:grid !important 会盖掉 UA 隐藏，须显式斩 */
.k-ais--chat details.k-ais__card:not([open]) > *:not(summary) {
    display: none !important;
}

/* ── ais-phrase-fix 2026-10-11：单 TV 头像 + 一句「挑好了这组已挑好」── */
.k-ais--chat .k-ais__state-icon,
.k-ais__state-icon,
.k-ais--chat .k-ais__state-play,
.k-ais__state-play {
    display: none !important;
}
.k-ais--chat .k-ais__status,
.k-ais__status {
    display: block;
    margin: 0.75rem 0 0;
}
.k-ais--chat .k-ais__state-phrase,
.k-ais__state-phrase {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
    max-width: 100%;
    line-height: 1.5;
}
.k-ais--chat .k-ais__state-phrase .k-ais__state,
.k-ais__state-phrase .k-ais__state {
    display: inline-flex;
    align-items: center;
    height: 1.625rem;
    padding: 0 0.625rem;
    border-radius: 999px;
    border: 1px solid rgb(22 224 157 / 42%);
    background: rgb(22 224 157 / 12%);
    color: rgb(22 224 157);
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: baseline;
}

/* 空结果：中性 pill + 查找不到面板（勿再只显示「已完成」） */
.k-ais__turn--empty .k-ais__state-phrase .k-ais__state,
.k-msg.k-ais__turn--empty .k-ais__state {
    border-color: rgb(148 163 184 / 36%);
    background: rgb(148 163 184 / 10%);
    color: var(--k-text-muted, #9aa3b2);
}
.k-ais__turn--empty .k-ais__sum {
    color: var(--k-text-muted, #9aa3b2);
    font-weight: 500;
}
.k-ais__empty {
    margin-top: 0.875rem;
    padding: 1.5rem 1.1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--k-border-soft, rgb(255 255 255 / 8%));
    background: var(--k-tint, rgb(255 255 255 / 3%));
    text-align: center;
}
.k-ais__empty-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    border-radius: 999px;
    border: 1px solid rgb(148 163 184 / 28%);
    background: rgb(148 163 184 / 8%);
    color: var(--k-text-muted, #9aa3b2);
}
.k-ais__empty-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--k-text, #e8eaed);
}
.k-ais__empty-desc {
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--k-text-muted, #9aa3b2);
}
.k-ais__empty .k-ais-alt--empty {
    margin-top: 1.1rem;
    text-align: left;
}
.k-ais__empty .k-ais-alt__title {
    margin-bottom: 0.65rem;
    font-size: 0.875rem;
}
.k-ais--chat .k-ais__state-phrase .k-ais__state-sub,
.k-ais__state-phrase .k-ais__state-sub {
    display: inline;
    margin-left: 0.4rem;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    height: auto;
    color: var(--k-text-muted, #9aa3b2);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ── ais-layout-fix 2026-10-11 executor ── */
/* 1) 完成态：单 TV 头像与「挑好了这组已挑好」同一行垂直居中 */
.k-ais--chat .k-ais__turn,
.k-ais--chat .k-msg--ai.k-ais__turn {
    align-items: flex-start;
}
.k-ais--chat .k-ais__turn > .k-msg__body {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}
/* 头像与首行状态短语垂直居中：把 status 当作与头像对齐的第一行 */
.k-ais--chat .k-ais__turn {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.625rem;
}
.k-ais--chat .k-ais__turn > .k-msg__avatar,
.k-ais--chat .k-msg--ai > .k-msg__avatar {
    flex: 0 0 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    align-self: flex-start;
    margin-top: 0; /* 与 status 顶对齐，等高即垂直居中 */
}
.k-ais--chat .k-ais__status {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 0;
    margin: 0 0 0.5rem !important; /* 顶与头像齐平 */
    min-height: 1.75rem;
}
.k-ais--chat .k-ais__state-phrase {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 0;
    line-height: 1.75rem;
}
.k-ais--chat .k-ais__state-phrase .k-ais__state {
    display: inline-flex !important;
    align-items: center;
    height: 1.625rem;
    padding: 0 0.625rem;
    border-radius: 999px;
    border: 1px solid rgb(22 224 157 / 42%);
    background: rgb(22 224 157 / 12%);
    color: rgb(22 224 157);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}
.k-ais--chat .k-ais__state-phrase .k-ais__state-sub {
    display: inline !important;
    margin-left: 0.4rem;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    height: auto !important;
    color: var(--k-text-muted, #9aa3b2);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.625rem;
    vertical-align: middle;
}
/* 斩多余第二头像（状态区 TV/+） */
.k-ais--chat .k-ais__state-icon,
.k-ais--chat .k-ais__state-play,
.k-ais__state-icon,
.k-ais__state-play {
    display: none !important;
}

/* 2) 结果卡：按钮完整包在卡内，勿溢出底边 */
.k-ais--chat .k-ais__row {
    display: flex !important;
    align-items: stretch;
    gap: 12px;
    padding: 10px !important;
    min-width: 0;
    height: auto !important;          /* 勿锁死 height:100% 挤爆 */
    min-height: 0;
    overflow: visible !important;
    box-sizing: border-box;
}
.k-ais--chat .k-ais__info {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: visible;
    /* 保证 ops 有落脚点且不被裁切 */
    padding-bottom: 0;
}
.k-ais--chat .k-ais__ops {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 0;
    flex: 0 0 auto;
    padding-top: 4px;
    /* 防止子项被压扁/溢出 */
    min-height: 32px;
    width: 100%;
    box-sizing: border-box;
}
.k-ais--chat .k-ais__ops .k-ais__play,
.k-ais--chat .k-ais__ops .k-ais__fav {
    flex: 0 0 auto;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px;
    box-sizing: border-box;
}
.k-ais--chat .k-ais__poster {
    flex: 0 0 90px !important;
    width: 90px !important;
    height: 135px !important;
    align-self: flex-start;
    overflow: hidden;
    border-radius: 8px;
}
.k-ais--chat .k-ais__poster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
@media (min-width: 900px) {
    .k-ais--chat .k-ais__poster {
        flex: 0 0 108px !important;
        width: 108px !important;
        height: 162px !important;
    }
}
/* 网格卡等高时：info 填满，ops 贴底但仍在 padding 内 */
.k-ais--chat .k-ais__rows {
    align-items: stretch;
}
.k-ais--chat .k-ais__rows > .k-ais__row {
    height: auto;
}

/* 3) 详情侧栏海报：完整竖版 2:3，勿压成细条 */
.k-ais-drawer__hero {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}
.k-ais-drawer__poster {
    position: relative;
    flex: 0 0 7.5rem !important;
    width: 7.5rem !important;
    max-width: 7.5rem !important;
    height: 11.25rem !important; /* 2:3 */
    min-height: 11.25rem !important;
    aspect-ratio: var(--k-cover-ratio);
    margin: 0 !important;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid var(--k-border-soft, var(--k-border));
    background: var(--k-surface, #25262b);
    box-shadow: 0 4px 16px rgb(0 0 0 / 30%);
}
.k-ais-drawer__poster img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
    object-position: center top;
}
.k-ais-drawer__hero-main {
    flex: 1 1 auto;
    min-width: 0;
}
@media (min-width: 768px) {
    .k-ais-drawer__hero {
        display: flex !important;
        grid-template-columns: none !important;
    }
    .k-ais-drawer__poster {
        flex: 0 0 9rem !important;
        width: 9rem !important;
        max-width: 9rem !important;
        height: 13.5rem !important;
        min-height: 13.5rem !important;
        aspect-ratio: var(--k-cover-ratio) !important;
    }
}

/* ── ais-bar-home-right 2026-10-11 ── */
.k-ais__bar .k-ais__home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    padding: 0 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--k-interactive-border, rgb(255 255 255 / 14%));
    background: rgb(255 255 255 / 4%);
    color: var(--k-text-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    z-index: 1;
    justify-self: end;
}
.k-ais__bar .k-ais__home-link:hover {
    color: var(--k-text);
    border-color: var(--k-interactive-border-hover, rgb(255 255 255 / 28%));
    background: rgb(255 255 255 / 8%);
}
/* /ai-search：右上「返回首页」文字；/ai-chat/:id 会话：右上新建会话（对照源站 session） */
.k-ais--chat .k-ais__bar > .k-ais__edit { display: none; }
.k-ais--chat.k-ais--session .k-ais__bar > .k-ais__home-link { display: none; }
.k-ais--chat.k-ais--session .k-ais__bar > .k-ais__edit,
.k-ais--chat.k-ais--session .k-ais__bar > .k-ais__edit--link {
    display: inline-flex;
    justify-self: end;
}
.k-ais--chat.k-ais--session .k-ais__edit--link {
    text-decoration: none;
}



/* ── ais-alt 2026-10-11 · 换个方式三卡 ── */
.k-ais-alt {
    margin: 1rem 0 0.25rem;
    padding: 0.85rem 0.15rem 0.35rem;
    border-top: 1px solid var(--k-border-soft, rgb(255 255 255 / 8%));
}
.k-ais-alt__title {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--k-text);
}
.k-ais-alt__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
}
.k-ais-alt__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.75rem 0.8rem;
    border-radius: 0.75rem;
    border: 1px solid var(--k-interactive-border, rgb(255 255 255 / 10%));
    background: var(--k-card-inner, rgb(255 255 255 / 3.5%));
    color: var(--k-text);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.k-ais-alt__card:hover {
    border-color: rgb(var(--k-primary-rgb) / 40%);
    background: rgb(var(--k-primary-rgb) / 6%);
}
.k-ais-alt__card > strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--k-text);
}
.k-ais-alt__card > span {
    font-size: 11px;
    line-height: 1.4;
    color: var(--k-text-muted);
}
.k-ais-rate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px dashed var(--k-border-soft, rgb(255 255 255 / 8%));
}
.k-ais-rate__q {
    font-size: 12px;
    color: var(--k-text-muted);
    font-weight: 600;
}
.k-ais-rate__acts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.k-ais-rate__btn {
    height: 1.7rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--k-interactive-border, rgb(255 255 255 / 12%));
    background: var(--k-tint, rgb(255 255 255 / 4%));
    color: var(--k-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.k-ais-rate__btn:hover {
    color: var(--k-text);
    border-color: rgb(var(--k-primary-rgb) / 35%);
}
.k-ais-rate__btn.is-on {
    background: rgb(22 224 157 / 16%);
    border-color: rgb(22 224 157 / 45%);
    color: var(--k-primary, #16e09d);
}
@media (max-width: 720px) {
    .k-ais-alt__grid { grid-template-columns: 1fr; }
}

/* ── ais-fmore 2026-10-11 · 两层 chips ── */
.k-ais__chip--more {
    border-style: dashed !important;
    opacity: 0.92;
}
.k-ais-fmore[hidden] { display: none !important; }
.k-ais-fmore {
    position: fixed;
    inset: 0;
    z-index: 88;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.k-ais-fmore__mask {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 50%);
}
.k-ais-fmore__panel {
    position: relative;
    z-index: 1;
    width: min(36rem, 100%);
    max-height: min(78vh, 32rem);
    display: flex;
    flex-direction: column;
    border-radius: 1rem 1rem 0 0;
    background: var(--k-surface);
    border: 1px solid var(--k-interactive-border, rgb(255 255 255 / 10%));
    border-bottom: 0;
    box-shadow: 0 -16px 48px rgb(0 0 0 / 45%);
    padding: 0.75rem 0.875rem 1.1rem;
    gap: 0.65rem;
}
.k-ais-fmore__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.k-ais-fmore__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.k-ais-fmore__x {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / 6%);
    color: #c8d0dc;
    cursor: pointer;
    font-size: 0.95rem;
}
.k-ais-fmore__dims,
.k-ais-fmore__vals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.k-ais-fmore__dims {
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgb(255 255 255 / 8%);
}
.k-ais-fmore__vals {
    overflow: auto;
    max-height: 14rem;
    padding-bottom: 0.25rem;
}
.k-ais-fmore__chip {
    display: inline-flex;
    align-items: center;
    height: 1.85rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid rgb(255 255 255 / 12%);
    background: rgb(255 255 255 / 4%);
    color: #c8d0dc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.k-ais-fmore__chip > i {
    margin-left: 0.3rem;
    font-style: normal;
    opacity: 0.7;
    font-weight: 500;
}
.k-ais-fmore__chip.is-active,
.k-ais-fmore__chip[aria-selected="true"] {
    background: rgb(22 224 157 / 16%);
    border-color: rgb(22 224 157 / 45%);
    color: var(--k-primary, #16e09d);
}
.k-ais-fmore__dims .k-ais-fmore__chip.is-active {
    background: var(--k-primary, #16e09d);
    border-color: transparent;
    color: #04140f;
}
html[data-k-ais-fmore-open] { overflow: hidden; }
@media (min-width: 720px) {
    .k-ais-fmore { align-items: center; padding: 1rem; }
    .k-ais-fmore__panel {
        border-radius: 0.9rem;
        border-bottom: 1px solid rgb(255 255 255 / 10%);
        max-height: min(70vh, 28rem);
    }
}

/* ── ais-pip 2026-10-11 · ArtPlayer 浮动小窗 ── */
.k-ais-pip[hidden] { display: none !important; }
/* root = 全屏遮罩层（半透明），不是播放器本体 */
.k-ais-pip {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) 0.75rem max(0.75rem, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    pointer-events: none; /* 仅 mask/panel 可点 */
}
.k-ais-pip__mask {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 55%);
    pointer-events: auto;
}
.k-ais-pip__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    align-self: center;
    box-sizing: border-box;
    /* 浮动小窗：宽≤95vw、高≤70vh；桌面再封顶 ~880 */
    width: min(880px, 95vw);
    max-width: 95vw;
    height: auto;
    max-height: 70vh;
    border-radius: 0.85rem;
    border: 1px solid var(--k-border-soft, var(--k-border));
    background: var(--k-bg-deep, var(--k-bg));
    box-shadow: 0 24px 64px rgb(0 0 0 / 55%);
    overflow: hidden;
    pointer-events: auto;
}
.k-ais-pip__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgb(var(--k-primary-rgb) / 18%);
    flex: 0 0 auto;
}
.k-ais-pip__titles { flex: 1; min-width: 0; }
.k-ais-pip__title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--k-text);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.k-ais-pip__meta {
    margin: 0.15rem 0 0;
    font-size: 11px;
    color: var(--k-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.k-ais-pip__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}
.k-ais-pip__close {
    height: 1.75rem;
    padding: 0 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--k-interactive-border, var(--k-border));
    background: rgb(var(--k-hover-rgb) / 55%);
    color: var(--k-text);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.k-ais-pip__close:hover { color: var(--k-text); background: rgb(var(--k-hover-rgb) / 72%); }
.k-ais-pip__detail {
    display: inline-flex;
    align-items: center;
    height: 1.75rem;
    padding: 0 0.65rem;
    border-radius: 999px;
    border: 0;
    background: var(--k-primary);
    color: var(--k-primary-ink, #04140f);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
.k-ais-pip__detail:hover { filter: brightness(1.06); }
.k-ais-pip__skip {
    margin: 0;
    padding: 0.35rem 0.75rem;
    background: rgb(22 224 157 / 10%);
    color: rgb(22 224 157);
    font-size: 11px;
    font-weight: 600;
    border-bottom: 1px solid rgb(22 224 157 / 18%);
    flex: 0 0 auto;
}
.k-ais-pip__stage {
    position: relative;
    flex: 0 1 auto;
    width: 100%;
    min-height: 10rem;
    /* 给头/跳过条留空，整窗仍 ≤70vh */
    max-height: min(52vh, calc(70vh - 5.5rem));
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}
.k-ais-pip__loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--k-text-muted);
    font-size: 13px;
    z-index: 1;
    background: #000;
}
.k-ais-pip__loading[hidden] { display: none !important; }
.k-ais-pip__apt {
    position: absolute !important;
    inset: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    gap: 0 !important;
}
.k-ais-pip__apt[hidden] { display: none !important; }
.k-ais-pip__apt .k-apt__mount {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
}
.k-ais-pip__apt .k-apt__mount .art-video-player {
    width: 100%;
    height: 100%;
}
/* 禁止 ArtPlayer 网页全屏把小窗撑成整屏 */
.k-ais-pip .art-video-player.art-fullscreen-web,
.k-ais-pip .artplayer-app.art-fullscreen-web {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}
html[data-k-ais-pip-open] { overflow: hidden; }
@media (max-width: 640px) {
    .k-ais-pip {
        padding: 0.65rem;
    }
    .k-ais-pip__panel {
        /* H5 更小浮动窗：宽 ≤70vw，高 ≤70vh */
        width: min(70vw, 22rem);
        max-width: 70vw;
        max-height: 70vh;
        border-radius: 0.7rem;
    }
    .k-ais-pip__stage {
        min-height: 8rem;
        max-height: min(42vh, calc(70vh - 5.25rem));
    }
}




/* ── ais-dock-flat 2026-10-12 · 去掉 dock 与 composer 双层边框/底 ── */
.k-ais--chat .k-ais__dock {
    border-top: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 10px 0 12px;
    margin-top: 10px;
}
.k-ais--chat .k-ais__dock .k-ais__composer {
    margin-top: 0 !important;
}
/* 取消 pages.css 在 dock 上叠的弱 focus 环，只保留 .k-composer 一层 */
.k-ais--chat .k-ais__dock .k-ais__composer:focus-within {
    border-color: rgb(var(--k-primary-rgb) / 56%);
    box-shadow: inset 0 1px rgb(255 255 255 / 6%), 0 0 0 3px rgb(var(--k-primary-rgb) / 14%), 0 16px 42px rgb(0 0 0 / 22%);
}
@media (max-width: 1023.98px) {
    .k-ais--chat .k-ais__dock {
        border-radius: 0 !important;
        border-top: none !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 8px 12px 10px;
    }
}

/* ── ais-ops-contain 2026-10-12 · 片单/播放必须完整包在卡内 ──
   根因：先前 min-height:0 + overflow:visible 让 grid 行可矮于内容，ops 画出底边。
   斩：行高随内容（min-height:min-content），overflow 收住；ops flex-shrink:0 贴底仍在 padding 内。 */
.k-ais--chat .k-ais__rows {
    align-items: stretch;
}
.k-ais--chat .k-ais__rows > .k-ais__row,
.k-ais--chat .k-ais__row {
    display: flex !important;
    flex-direction: row;
    align-items: stretch !important;
    gap: 12px;
    padding: 10px !important;
    box-sizing: border-box !important;
    min-width: 0;
    height: auto !important;
    min-height: min-content !important; /* 勿再 min-height:0 被 grid 压矮 */
    max-height: none !important;
    overflow: hidden !important;        /* 兜底裁切，正常时 ops 本就在内 */
}
.k-ais--chat .k-ais__poster {
    flex: 0 0 90px !important;
    width: 90px !important;
    height: 135px !important;
    align-self: flex-start !important;
    overflow: hidden;
    border-radius: 8px;
}
@media (min-width: 900px) {
    .k-ais--chat .k-ais__poster {
        flex: 0 0 108px !important;
        width: 108px !important;
        height: 162px !important;
    }
}
.k-ais--chat .k-ais__info {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto !important;
    /* info 可在行内收缩，但 ops 不压扁 */
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
}
.k-ais--chat .k-ais__info h3,
.k-ais--chat .k-ais__meta {
    flex: 0 0 auto;
}
.k-ais--chat .k-ais__tags {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.k-ais--chat .k-ais__ops {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding-top: 4px;
    flex: 0 0 auto !important;   /* 永不被压出卡外 */
    flex-shrink: 0 !important;
    width: 100%;
    min-height: 32px;
    box-sizing: border-box;
    position: relative !important; /* 勿 absolute 飞出 */
    overflow: visible;
}
.k-ais--chat .k-ais__ops .k-ais__play,
.k-ais--chat .k-ais__ops .k-ais__fav {
    flex: 1 1 0 !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    box-sizing: border-box !important;
    position: relative !important;
    margin: 0 !important;
}

.k-chat__empty-desc {
    margin: 0;
    font-size: var(--k-fs-sm, 0.875rem);
    color: var(--k-text-subtle, #8b93a7);
}

/* ── html.light · AIS 对比度补强 2026-10-13b（基类已改 token；此处再钉死防缓存/覆盖）── */
html.light .k-ais-alt {
    border-top-color: rgba(23, 33, 29, 0.12) !important;
}
html.light .k-ais-alt__title {
    color: #17211d !important;
}
html.light .k-ais-alt__card {
    border-color: rgba(23, 33, 29, 0.22) !important;
    background: #e4ebe7 !important;
    color: #17211d !important;
    box-shadow: 0 1px 0 rgba(23, 33, 29, 0.06);
}
html.light .k-ais-alt__card:hover {
    border-color: rgb(6 122 84 / 45%) !important;
    background: rgb(6 122 84 / 10%) !important;
}
html.light .k-ais-alt__card > strong,
html.light .k-ais-alt__card strong {
    color: #17211d !important;
}
html.light .k-ais-alt__card > span,
html.light .k-ais-alt__card span {
    color: rgba(23, 33, 29, 0.72) !important;
}

html.light .k-ais-rate {
    border-top-color: rgba(23, 33, 29, 0.14) !important;
}
html.light .k-ais-rate__q {
    color: rgba(23, 33, 29, 0.72) !important;
}
html.light .k-ais-rate__btn {
    border-color: rgba(23, 33, 29, 0.28) !important;
    background: #e4ebe7 !important;
    color: #17211d !important;
}
html.light .k-ais-rate__btn:hover {
    color: #17211d !important;
    border-color: rgb(6 122 84 / 45%) !important;
    background: rgb(6 122 84 / 10%) !important;
}

/* 筛选 chip */
html.light .k-ais--chat .k-ais__chips > button,
html.light .k-ais--chat .k-ais__chips > .k-ais__chip,
html.light .k-ais--chat .k-ais__chips > a,
html.light .k-msg__ais-card .k-ais__chips > button,
html.light .k-msg__ais-card .k-ais__chips > a,
html.light .k-msg__filter {
    color: #17211d !important;
    border-color: rgba(23, 33, 29, 0.22) !important;
    background: rgba(23, 33, 29, 0.06) !important;
}
html.light .k-ais--chat .k-ais__chips > button > i,
html.light .k-ais--chat .k-ais__chips > .k-ais__chip > i {
    color: rgba(23, 33, 29, 0.72) !important;
}
html.light .k-ais--chat .k-ais__chips > button[aria-current="true"],
html.light .k-ais--chat .k-ais__chips > button.is-active,
html.light .k-ais--chat .k-ais__chips > .k-ais__chip.is-active {
    border-color: rgb(6 122 84 / 48%) !important;
    background: rgb(6 122 84 / 12%) !important;
    color: #067a54 !important;
}
html.light .k-ais--chat .k-ais__chips > button[aria-current="true"] > i,
html.light .k-ais--chat .k-ais__chips > button.is-active > i {
    color: #067a54 !important;
}

html.light .k-ais-fmore__title { color: #17211d !important; }
html.light .k-ais-fmore__x {
    background: rgba(23, 33, 29, 0.06) !important;
    color: rgba(23, 33, 29, 0.72) !important;
}
html.light .k-ais-fmore__dims { border-bottom-color: rgba(23, 33, 29, 0.12) !important; }
html.light .k-ais-fmore__chip {
    border-color: rgba(23, 33, 29, 0.22) !important;
    background: rgba(23, 33, 29, 0.06) !important;
    color: #17211d !important;
}
html.light .k-ais-fmore__panel {
    border-color: rgba(23, 33, 29, 0.14) !important;
    box-shadow: 0 -16px 48px rgb(0 0 0 / 12%);
}

html.light .k-ais__state-sub,
html.light .k-ais__sub,
html.light .k-ais__meta,
html.light .k-ais--chat .k-ais__meta,
html.light .k-msg__ais-card .k-ais__meta,
html.light .k-srch__hint,
html.light .k-chat__empty-desc,
html.light .k-ais-drawer__meta,
html.light .k-ais-drawer__empty {
    color: rgba(23, 33, 29, 0.72) !important;
}
html.light .k-ais__mode {
    color: #067a54 !important;
}

/* ── kanju41 会话搜片：结果卡 + 详情侧栏（对照 /session/…）── */
.k-ais--chat .k-ais__row {
    background: var(--k-surface, #1e1f24);
    border: 1px solid var(--k-border-soft, rgb(255 255 255 / 10%));
    border-radius: 10px;
    box-shadow: 0 1px 0 rgb(0 0 0 / 22%);
}

.k-ais--chat .k-ais__info {
    position: relative;
    padding-right: 1.75rem;
    gap: 5px;
}

.k-ais--chat .k-ais__info h3 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin: 0;
    padding-right: 0;
}

.k-ais--chat .k-ais__info h3 a {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.k-ais--chat .k-ais__meta {
    margin: 0;
    font-size: 11px;
    color: var(--k-text-subtle, #8b93a2);
}

.k-ais--chat .k-ais__more {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--k-border-soft, rgb(255 255 255 / 14%));
    background: rgb(255 255 255 / 5%);
    color: var(--k-text-muted);
    font-size: 11px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.k-ais--chat .k-ais__more:hover {
    color: var(--k-primary);
    border-color: rgb(var(--k-primary-rgb, 22 224 157) / 45%);
}

.k-ais--chat .k-ais__vers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.k-ais--chat .k-ais__ver {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--k-border-soft, rgb(255 255 255 / 12%));
    background: rgb(255 255 255 / 3%);
    color: var(--k-text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.k-ais--chat .k-ais__ver.is-active {
    border-color: rgb(var(--k-primary-rgb, 22 224 157) / 48%);
    background: rgb(var(--k-primary-rgb, 22 224 157) / 12%);
    color: var(--k-primary);
}

.k-ais--chat .k-ais__tags span {
    height: 22px;
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid var(--k-border-soft, rgb(255 255 255 / 10%));
    background: transparent;
    font-size: 10.5px;
    line-height: 20px;
}

.k-ais--chat .k-ais__tag-query {
    color: var(--k-text-subtle);
}

.k-ais--chat .k-ais__ops .k-ais__fav,
.k-ais--chat .k-ais__ops .k-ais__play {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    border-radius: 8px;
}

.k-ais--chat .k-ais__ops .k-ais__fav {
    border: 1px solid var(--k-border-soft, rgb(255 255 255 / 12%));
    background: rgb(255 255 255 / 4%);
    color: var(--k-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.k-ais--chat .k-ais__ops .k-ais__play {
    font-size: 12px;
    font-weight: 700;
    min-height: 34px;
}

.k-ais--chat .k-ais__ops .k-ais__fav,
.k-ais--chat .k-ais__ops .k-ais__play,
.k-msg__ais-card .k-ais__ops .k-ais__fav,
.k-msg__ais-card .k-ais__ops .k-ais__play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.k-ais--chat .k-ais__ops .k-ais__fav svg,
.k-ais--chat .k-ais__ops .k-ais__play svg,
.k-msg__ais-card .k-ais__ops .k-ais__fav svg,
.k-msg__ais-card .k-ais__ops .k-ais__play svg,
.k-ais--chat .k-ais__ops .k-ais__ico {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    overflow: visible;
}

/* 搜片/会话 thread：可滚动但隐藏滚动条（对照源站） */
.k-ais--chat .k-ais__thread,
.k-ais--chat .k-ais__page-body,
.k-ais--chat[data-k-chat] .k-ais__page-body .k-ais__thread.k-chat__log {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.k-ais--chat .k-ais__thread::-webkit-scrollbar,
.k-ais--chat .k-ais__page-body::-webkit-scrollbar,
.k-ais--chat[data-k-chat] .k-ais__page-body .k-ais__thread.k-chat__log::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

@media (min-width: 1024px) {
    .k-ais-drawer__panel {
        width: min(36rem, 40vw);
        margin: 0.5rem 0.5rem 0.5rem 0;
        height: calc(100dvh - 1rem);
        max-height: calc(100dvh - 1rem);
        border-radius: 12px 0 0 12px;
    }

    .k-ais-drawer__mask {
        background: rgb(0 0 0 / 55%);
    }
}

.k-ais-drawer__lead {
    margin: 0.25rem 0 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--k-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.k-ais-drawer__lead[hidden] {
    display: none !important;
}

.k-ais-drawer__sechead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.k-ais-drawer__sechead h3 {
    margin: 0;
}

.k-ais-drawer__eps-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--k-text-subtle);
}

.k-ais-drawer__sec--eps .k-ais-drawer__eps > a {
    min-height: 2.5rem;
    border-radius: 8px;
    font-size: 13px;
}

.k-ais-drawer__foot {
    flex-direction: column;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, transparent, rgb(0 0 0 / 35%));
}

.k-ais-drawer__foot .k-ais-drawer__play {
    width: 100%;
    flex: none;
    height: 3rem;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
}

/* ── AI 生图卡（对照源站 movie-generated-image-card） ── */
.k-composer__chip.is-skill {
    padding-right: 4px;
    gap: 4px;
}
.k-composer__chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}
.k-composer__chip-x:hover { opacity: 1; background: rgb(var(--k-primary-rgb) / 18%); }

/* 生图卡收窄为海报宽；下方改路入口仍用正文全宽 */
.k-img-card {
    margin-top: 10px;
    width: 168px;
    max-width: min(168px, 46vw);
}
.k-img-card__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border: 1px solid var(--k-border, rgb(255 255 255 / 12%));
    border-radius: 12px;
    background: var(--k-surface, #12181c);
    box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
}
.k-img-card__wait { position: absolute; inset: 0; pointer-events: none; }
.k-img-card__wait-texture {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 18% 20%, rgb(var(--k-primary-rgb) / 18%), transparent 60%),
        radial-gradient(ellipse at 85% 75%, rgb(var(--k-primary-rgb) / 12%), transparent 60%),
        linear-gradient(135deg, rgb(var(--k-primary-rgb) / 8%), transparent);
}
.k-img-card__wait-sweep {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgb(var(--k-primary-rgb) / 22%) 50%, transparent 80%);
    animation: 3s ease-in-out infinite k-img-sweep;
}
.k-img-card__wait-vignette {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 45%, var(--k-surface, #12181c));
}
.k-img-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--k-border, rgb(255 255 255 / 14%));
    border-radius: 8px;
    background: rgb(7 13 16 / 72%);
    color: var(--k-text, #fff);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(6px);
}
.k-img-card__spin {
    display: inline-flex;
    color: var(--k-primary);
    animation: 1s linear infinite k-img-spin;
}
.k-img-card__ph {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgb(var(--k-primary-rgb) / 55%);
}
.k-img-card__img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.k-img-card__meta { margin-top: 10px; }
.k-img-card__track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(var(--k-primary-rgb) / 16%);
}
.k-img-card__bar {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--k-primary);
    transition: width 0.3s ease-out;
}
.k-img-card__bar.is-indeterminate {
    width: 35%;
    animation: 1.8s ease-in-out infinite k-img-pending;
}
.k-img-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    color: var(--k-text-muted, rgb(255 255 255 / 65%));
    font-size: 12px;
}
.k-img-card__row [data-k-img-pct] {
    color: var(--k-primary);
    font-weight: 700;
}
.k-img-card__eta {
    margin: 4px 0 0;
    color: var(--k-text-subtle, rgb(255 255 255 / 45%));
    font-size: 12px;
}
.k-img-card.is-fail .k-img-card__badge,
.k-img-card.is-fail [data-k-img-desc] {
    color: #f87171;
}
.k-img-card.is-done .k-img-card__wait,
.k-img-card.is-done .k-img-card__spin { display: none; }
.k-ais-alt--img { margin-top: 16px; }

@keyframes k-img-spin { to { transform: rotate(360deg); } }
@keyframes k-img-pending {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(390%); }
}
@keyframes k-img-sweep {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .k-img-card__spin,
    .k-img-card__bar.is-indeterminate,
    .k-img-card__wait-sweep { animation: none; }
}
