/* Chat home landing: left icon rail + centered creative composer + agents + inspiration gallery. */

/* 首页壳层覆盖：只使用 .chr-home（服务端渲染与内联脚本都会添加）。
   注意：不要与 :has([data-chr-home]) 写在同一个选择器列表里——不支持 :has() 的旧内核
   （部分国产 App WebView）会让整条规则失效，从而漏掉侧栏隐藏与全宽布局。 */
html body.page-chat.chr-home .front-creative-menu {
    display: none !important;
}

html body.page-chat.chr-home .app-layout {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

html body.page-chat.chr-home .main-area {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin-left: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #0f1014 !important;
}

html.jn-light-mode body.page-chat.chr-home .main-area {
    background: #f5f7fb !important;
}

body.chr-home {
    overflow: hidden;
}

.chr {
    --chr-bg: #0f1014;
    --chr-bg-soft: #14161c;
    --chr-rail-bg: #0c0d11;
    --chr-panel: #171920;
    --chr-panel-2: #1c1f27;
    --chr-panel-3: #232733;
    --chr-line: rgba(255, 255, 255, .09);
    --chr-line-strong: rgba(255, 255, 255, .16);
    --chr-text: #f5f6f8;
    --chr-soft: #c3c8d2;
    --chr-muted: #8f96a4;
    --chr-accent: #22d3ee;
    --chr-accent-2: #a855f7;
    --chr-accent-3: #f59e0b;
    --chr-shadow: 0 26px 66px rgba(0, 0, 0, .42);
    --chr-shadow-soft: 0 16px 38px rgba(0, 0, 0, .26);
    --chr-overlay: rgba(7, 9, 14, .74);
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-columns: 76px 264px minmax(0, 1fr);
    overflow: hidden;
    background:
        radial-gradient(900px 480px at 18% -8%, rgba(34, 211, 238, .11), transparent 62%),
        radial-gradient(760px 420px at 82% 0%, rgba(168, 85, 247, .12), transparent 60%),
        var(--chr-bg);
    color: var(--chr-text);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

html.jn-light-mode .chr,
html[data-theme="light"] .chr,
body.jn-light-mode .chr,
body[data-theme="light"] .chr {
    --chr-bg: #f5f7fb;
    --chr-bg-soft: #eef2f8;
    --chr-rail-bg: #ffffff;
    --chr-panel: #ffffff;
    --chr-panel-2: #f8fafc;
    --chr-panel-3: #eef2f7;
    --chr-line: rgba(15, 23, 42, .09);
    --chr-line-strong: rgba(15, 23, 42, .16);
    --chr-text: #0d1526;
    --chr-soft: #334155;
    --chr-muted: #64748b;
    --chr-accent: #0891b2;
    --chr-accent-2: #7c3aed;
    --chr-accent-3: #d97706;
    --chr-shadow: 0 24px 60px rgba(15, 23, 42, .12);
    --chr-shadow-soft: 0 14px 34px rgba(15, 23, 42, .08);
    --chr-overlay: rgba(15, 23, 42, .46);
    background:
        radial-gradient(900px 480px at 18% -8%, rgba(8, 145, 178, .10), transparent 62%),
        radial-gradient(760px 420px at 82% 0%, rgba(124, 58, 237, .10), transparent 60%),
        var(--chr-bg);
}

.chr,
.chr *,
.chr *::before,
.chr *::after {
    box-sizing: border-box;
}

.chr button,
.chr input,
.chr textarea,
.chr select {
    font: inherit;
    color: inherit;
}

.chr a {
    color: inherit;
    text-decoration: none;
}

.chr svg {
    width: 20px;
    height: 20px;
    display: block;
}

.chr .chr-icon-sun,
.chr .chr-icon-moon {
    display: none;
}

html.jn-light-mode .chr .chr-icon-moon,
html[data-theme="light"] .chr .chr-icon-moon,
body.jn-light-mode .chr .chr-icon-moon {
    display: block;
}

html:not(.jn-light-mode) .chr .chr-icon-sun,
html[data-theme="dark"] .chr .chr-icon-sun {
    display: block;
}

/* Rail */

.chr-rail {
    position: relative;
    z-index: 3;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 18px 0 20px;
    border-right: 1px solid var(--chr-line);
    background: color-mix(in srgb, var(--chr-rail-bg) 92%, transparent);
    backdrop-filter: blur(14px);
}

.chr-brand {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--chr-line);
    border-radius: 14px;
    background: var(--chr-panel);
    box-shadow: var(--chr-shadow-soft);
    transition: transform .18s ease, border-color .18s ease;
}

.chr-brand:hover {
    transform: translateY(-1px);
    border-color: var(--chr-line-strong);
}

.chr-brand img {
    width: 30px;
    height: 30px;
    display: block;
    object-fit: contain;
    border-radius: 8px;
}

.chr-rail-nav {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding-top: 4px;
}

.chr-rail-foot {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Account dock at the bottom of the rail: avatar, balance and 充值 pill stacked */
.chr-rail-account {
    align-self: flex-start;
    margin-left: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.chr-rail-account-avatar {
    position: relative;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 50%;
    background: var(--chr-panel-2);
    color: var(--chr-text);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease;
}

.chr-rail-account-avatar:hover {
    border-color: var(--chr-line-strong);
    transform: translateY(-1px);
}

.chr-rail-account-avatar > img:first-child {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.chr-rail-account-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    display: block;
    pointer-events: none;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

.chr-rail-account-balance {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--chr-text);
    cursor: pointer;
    line-height: 1;
}

.chr-rail-account-balance b {
    overflow: hidden;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-rail-account-balance span {
    color: var(--chr-muted);
    font-size: 9.5px;
    font-weight: 600;
}

.chr-rail-account-balance:hover b {
    color: #fbbf24;
}

/* 充值: compact amber pill under the balance */
.chr-rail-account-recharge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 214, 102, .5);
    border-radius: 6px;
    background: linear-gradient(180deg, #ffd873, #f2b23a);
    color: #4a3208;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.chr-rail-account-recharge:hover,
.chr-rail-account-recharge:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 226, 150, .8);
    box-shadow: 0 4px 10px rgba(242, 178, 58, .34);
    outline: none;
}

.chr-rail-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--chr-muted);
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.chr-rail-btn:hover {
    background: var(--chr-panel);
    border-color: var(--chr-line);
    color: var(--chr-text);
}

.chr-rail-btn:active {
    transform: scale(.96);
}

.chr-rail-btn.is-primary {
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #fff;
    box-shadow: 0 10px 24px rgba(34, 211, 238, .26);
}

.chr-rail-btn.is-primary:hover {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 14px 30px rgba(129, 106, 246, .38);
}

.chr-rail-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    z-index: 9;
    padding: 6px 10px;
    border: 1px solid var(--chr-line);
    border-radius: 8px;
    background: var(--chr-panel-3);
    color: var(--chr-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition: opacity .15s ease, transform .15s ease;
    box-shadow: var(--chr-shadow-soft);
}

.chr-rail-btn[data-tip]:hover::after,
.chr-rail-btn[data-tip]:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
}

/* 可配置左侧栏按钮：二级悬浮预览与整页选择 */

.chr-rail-item {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chr-rail-btn.is-static,
.chr-rail-btn.is-disabled {
    color: var(--chr-muted);
    cursor: not-allowed;
    opacity: .45;
    filter: grayscale(.4);
}

.chr-rail-btn.is-static:hover,
.chr-rail-btn.is-disabled:hover {
    border-color: transparent;
    background: transparent;
    color: var(--chr-muted);
    transform: none;
}

.chr-rail-icon-img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
    border-radius: 5px;
}

.chr-rail-emoji {
    font-size: 17px;
    line-height: 1;
}

.chr-rail-initial {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.chr-rail-dot {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .55;
}

.chr-rail-sub {
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    z-index: 24;
    min-width: 236px;
    max-width: 292px;
    padding: 8px 8px 4px;
    border: 1px solid var(--chr-line);
    border-radius: 14px;
    background: var(--chr-panel-3);
    box-shadow: var(--chr-shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-6px, -50%);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

/* 补一层透明区域，避免鼠标从按钮移向浮层时经过空隙而收起 */
.chr-rail-sub::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 0;
    bottom: 0;
    width: 14px;
}

.chr-rail-item.has-sub:hover > .chr-rail-sub,
.chr-rail-item.has-sub:focus-within > .chr-rail-sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(0, -50%);
}

.chr-rail-sub-title {
    margin: 2px 8px 6px;
    color: var(--chr-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* 一级按钮自己的跳转入口（浮层标题右侧） */
.chr-rail-sub-enter {
    flex: none;
    color: var(--chr-accent, #2f6bff);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0;
}

.chr-rail-sub-enter:hover {
    text-decoration: underline;
}

.chr-rail-sub-scroll {
    max-height: min(62vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.chr-rail-sub-group + .chr-rail-sub-group {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--chr-line);
}

.chr-rail-sub-group-title {
    margin: 6px 9px 3px;
    color: var(--chr-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
}

.chr-rail-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border-radius: 9px;
    color: var(--chr-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.chr-rail-sub-link:hover,
.chr-rail-sub-link:focus-visible {
    background: var(--chr-panel);
    outline: none;
}

.chr-rail-sub-link.is-disabled {
    color: var(--chr-muted);
    cursor: not-allowed;
    opacity: .5;
}

.chr-rail-sub-ico {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--chr-panel);
    color: var(--chr-accent);
}

.chr-rail-sub-ico .chr-rail-icon-img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}

.chr-rail-sub-ico .chr-rail-emoji {
    font-size: 16px;
}

.chr-rail-sub-ico .chr-rail-initial {
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.chr-rail-sub-link.is-disabled .chr-rail-sub-ico {
    color: var(--chr-muted);
}

.chr-rail-sub-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chr-rail-sub-name {
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-rail-sub-desc {
    overflow: hidden;
    color: var(--chr-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-rail-sub-more {
    width: 100%;
    margin-top: 4px;
    padding: 7px 10px;
    border: 0;
    border-top: 1px solid var(--chr-line);
    border-radius: 0 0 9px 9px;
    background: none;
    color: var(--chr-accent);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.chr-rail-sub-more:hover,
.chr-rail-sub-more:focus-visible {
    color: var(--chr-text);
    outline: none;
}

.chr-rail-subpage {
    position: fixed;
    inset: 0;
    z-index: 100200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.chr-rail-subpage[hidden] {
    display: none;
}

.chr-rail-subpage-backdrop {
    position: absolute;
    inset: 0;
    background: var(--chr-overlay);
    backdrop-filter: blur(6px);
}

.chr-rail-subpage-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: min(80vh, 640px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--chr-line);
    border-radius: 20px;
    background: var(--chr-panel);
    box-shadow: var(--chr-shadow);
    animation: chr-rail-subpage-in .18s ease;
}

@keyframes chr-rail-subpage-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.chr-rail-subpage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.chr-rail-subpage-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--chr-text);
    font-size: 17px;
    font-weight: 800;
}

.chr-rail-subpage-ico {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--chr-line);
    border-radius: 10px;
    background: var(--chr-panel-2);
    color: var(--chr-accent);
}

.chr-rail-subpage-close {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 10px;
    background: var(--chr-panel-2);
    color: var(--chr-muted);
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease;
}

.chr-rail-subpage-close:hover,
.chr-rail-subpage-close:focus-visible {
    border-color: var(--chr-line-strong);
    color: var(--chr-text);
    outline: none;
}

.chr-rail-subpage-desc {
    margin: 0 0 14px;
    color: var(--chr-muted);
    font-size: 13px;
    line-height: 1.6;
}

.chr-rail-subpage-group + .chr-rail-subpage-group {
    margin-top: 18px;
}

.chr-rail-subpage-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 9px;
    color: var(--chr-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

.chr-rail-subpage-group-title::before {
    content: "";
    flex: none;
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--chr-accent);
}

.chr-rail-subpage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.chr-rail-subpage-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--chr-line);
    border-radius: 14px;
    background: var(--chr-panel-2);
    color: var(--chr-text);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.chr-rail-subpage-card:hover,
.chr-rail-subpage-card:focus-visible {
    border-color: var(--chr-line-strong);
    background: var(--chr-panel-3);
    transform: translateY(-1px);
    outline: none;
}

.chr-rail-subpage-card.is-disabled {
    cursor: not-allowed;
    opacity: .5;
    transform: none;
}

.chr-rail-subpage-card-ico {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--chr-panel);
    color: var(--chr-accent);
}

.chr-rail-subpage-card-ico .chr-rail-emoji {
    font-size: 18px;
}

.chr-rail-subpage-card-ico .chr-rail-icon-img {
    width: 26px;
    height: 26px;
    border-radius: 7px;
}

.chr-rail-subpage-ico .chr-rail-icon-img {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

.chr-rail-subpage-card-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.chr-rail-subpage-card-body b {
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-rail-subpage-card-body small {
    overflow: hidden;
    color: var(--chr-muted);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-rail-subpage-card-arrow {
    flex: 0 0 auto;
    color: var(--chr-muted);
    font-size: 15px;
}

@media (max-width: 760px) {
    .chr-rail-sub {
        display: none;
    }

    .chr-rail-subpage {
        align-items: flex-end;
        padding: 12px;
    }

    .chr-rail-subpage-panel {
        max-height: 86vh;
        border-radius: 18px;
    }

    .chr-rail-subpage-grid {
        grid-template-columns: 1fr;
    }
}

/* History sidebar */

.chr-history {
    grid-column: 2;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 16px 12px 14px;
    border-right: 1px solid var(--chr-line);
    background: color-mix(in srgb, var(--chr-rail-bg) 82%, transparent);
    backdrop-filter: blur(14px);
}

.chr-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px 12px;
}

.chr-history-title {
    color: var(--chr-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
}

.chr-history-close {
    width: 30px;
    height: 30px;
    display: none;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--chr-muted);
    cursor: pointer;
}

.chr-history-close:hover {
    border-color: var(--chr-line);
    background: var(--chr-panel);
    color: var(--chr-text);
}

.chr-history-close svg {
    width: 18px;
    height: 18px;
}

.chr-history-new {
    width: 100%;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 38%, var(--chr-line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--chr-accent) 12%, var(--chr-panel));
    color: var(--chr-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.chr-history-new:hover {
    border-color: color-mix(in srgb, var(--chr-accent) 62%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 18%, var(--chr-panel));
    transform: translateY(-1px);
}

.chr-history-new svg {
    width: 16px;
    height: 16px;
}

.chr-history-scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--chr-line-strong) transparent;
}

.chr-history-scroll::-webkit-scrollbar {
    width: 6px;
}

.chr-history-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--chr-line-strong);
}

.chr-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0 2px 6px;
    list-style: none;
}

.chr-history-item {
    width: 100%;
    display: block;
    padding: 9px 58px 9px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--chr-soft);
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.chr-history-list li {
    position: relative;
}

.chr-history-item-edit {
    position: absolute;
    right: 31px;
    top: 6px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--chr-muted);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    opacity: .55;
    pointer-events: auto;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}

.chr-history-item-delete {
    position: absolute;
    right: 5px;
    top: 6px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--chr-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: .55;
    pointer-events: auto;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}

.chr-history-item-edit[hidden],
.chr-history-item-delete[hidden] {
    display: none;
}

.chr-history-list li:hover .chr-history-item-edit,
.chr-history-list li:focus-within .chr-history-item-edit,
.chr-history-list li:hover .chr-history-item-delete,
.chr-history-list li:focus-within .chr-history-item-delete {
    opacity: 1;
}

.chr-history-item-edit:hover {
    background: color-mix(in srgb, var(--chr-text) 12%, transparent);
    color: var(--chr-text);
}

.chr-history-item-delete:hover {
    background: rgba(239, 68, 68, .16);
    color: #f87171;
}

.chr-history-rename-input {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 2px;
    bottom: 2px;
    width: auto;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 58%, var(--chr-line));
    border-radius: 11px;
    background: var(--chr-panel);
    color: var(--chr-text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    padding: 9px 10px;
    outline: none;
    z-index: 4;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--chr-accent) 18%, transparent);
}

@media (hover: none) {
    .chr-history-item-edit,
    .chr-history-item-delete {
        opacity: .72;
        pointer-events: auto;
    }
}

.chr-history-item:hover {
    border-color: var(--chr-line);
    background: var(--chr-panel);
    color: var(--chr-text);
}

.chr-history-item.is-active {
    border-color: color-mix(in srgb, var(--chr-accent) 42%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 13%, var(--chr-panel));
    color: var(--chr-text);
}

.chr-history-item-title {
    display: block;
    overflow: hidden;
    color: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-history-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.4;
}

.chr-history-item-meta span + span::before {
    content: "·";
    margin-right: 6px;
}

.chr-history-status {
    margin: 6px 4px 0;
    color: var(--chr-muted);
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

.chr-history-status[hidden] {
    display: none;
}

.chr-history-status.is-error {
    color: #ef4444;
}

.chr-history-backdrop {
    display: none;
}

.chr-top-btn {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, transform .16s ease;
}

.chr-top-btn:hover {
    border-color: var(--chr-line-strong);
    color: var(--chr-text);
    transform: translateY(-1px);
}

.chr-top-btn svg {
    width: 19px;
    height: 19px;
}

@media (min-width: 761px) {
    .chr.is-history-collapsed {
        grid-template-columns: 76px 0 minmax(0, 1fr);
    }

    .chr.is-history-collapsed .chr-history {
        display: none;
    }
}

/* Main column */

.chr-main {
    grid-column: 3;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.chr-top {
    flex: 0 0 auto;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 30px;
}

.chr-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chr-login-btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 45%, var(--chr-line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-accent) 14%, var(--chr-panel));
    color: var(--chr-text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--chr-shadow-soft);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.chr-login-btn:hover {
    border-color: color-mix(in srgb, var(--chr-accent) 70%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 20%, var(--chr-panel));
    transform: translateY(-1px);
}

.chr-login-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--chr-accent) 60%, transparent);
    outline-offset: 2px;
}

.chr-credits {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 8px 0 12px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-text);
    cursor: pointer;
    box-shadow: var(--chr-shadow-soft);
    transition: border-color .18s ease, transform .18s ease;
}

.chr-credits:hover {
    border-color: var(--chr-line-strong);
    transform: translateY(-1px);
}

.chr-credits-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(140deg, #fbbf24, #f97316);
    color: #241503;
}

.chr-credits-icon svg {
    width: 13px;
    height: 13px;
}

.chr-credits b {
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .01em;
}

.chr-credits > span:not(.chr-credits-icon) {
    color: var(--chr-muted);
    font-size: 11px;
    font-weight: 600;
}

.chr-credits i {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    margin-left: 2px;
    border-radius: 50%;
    background: var(--chr-panel-3);
    color: var(--chr-soft);
    font-size: 15px;
    font-style: normal;
    line-height: 1;
}

.chr-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 50%;
    background: var(--chr-panel-2);
    color: var(--chr-text);
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease;
}

.chr-avatar:hover {
    border-color: var(--chr-line-strong);
    transform: translateY(-1px);
}

.chr-avatar-image {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.chr-avatar-initial {
    font-size: 15px;
    font-weight: 800;
    color: var(--chr-text);
}

.chr-avatar-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    display: block;
    pointer-events: none;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

/* Scroll region */

.chr-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 30px 46px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--chr-line-strong) transparent;
}

.chr-scroll::-webkit-scrollbar {
    width: 8px;
}

.chr-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--chr-line-strong);
    background-clip: padding-box;
}

.chr-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.chr-scroll > * {
    width: 100%;
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

/* 智能体卡片与灵感广场铺满内容区，仅这两块解除 1120px 限宽 */
.chr-scroll > .chr-agents,
.chr-scroll > .chr-gallery {
    max-width: none;
}

/* Hero */

.chr-hero {
    /* 在上一版基础上再上移 15px：继续压缩输入框上方留白，输入框及下方模块整体跟进 */
    padding: clamp(0px, calc(7vh - 70px), 6px) 0 clamp(0px, calc(7vh - 59px), 11px);
    text-align: center;
    animation: chrRise .5s ease both;
}

.chr-hero-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 6px 14px 6px 6px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--chr-shadow-soft);
}

.chr-hero-brand img {
    width: 30px;
    height: 30px;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

.chr-hero h1 {
    margin: 0;
    font-size: clamp(30px, 4.6vw, 52px);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -.02em;
}

.chr-hero h1 em {
    font-style: normal;
    background: linear-gradient(100deg, var(--chr-accent) 0%, var(--chr-accent-2) 62%, var(--chr-accent-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.chr-hero p {
    max-width: 560px;
    margin: 14px auto 0;
    color: var(--chr-muted);
    font-size: 14px;
    line-height: 1.75;
}

/* Composer */

.chr-composer-wrap {
    position: relative;
    max-width: 880px;
    animation: chrRise .55s .06s ease both;
}

.chr-composer {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px 16px 12px;
    border: 1px solid var(--chr-line-strong);
    border-radius: 26px;
    background: color-mix(in srgb, var(--chr-panel) 94%, transparent);
    box-shadow: var(--chr-shadow);
    backdrop-filter: blur(18px);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.chr-composer:focus-within {
    border-color: color-mix(in srgb, var(--chr-accent) 56%, var(--chr-line-strong));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--chr-accent) 12%, transparent), var(--chr-shadow);
}

.chr-input {
    width: 100%;
    min-height: 56px;
    max-height: 200px;
    display: block;
    padding: 4px 6px 2px;
    border: 0;
    outline: 0;
    resize: none;
    overflow-y: auto;
    background: transparent;
    color: var(--chr-text);
    font-size: 16px;
    line-height: 1.7;
}

.chr-input::placeholder {
    color: var(--chr-muted);
}

.chr-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.chr-tool-left,
.chr-tool-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chr-icon-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    background: var(--chr-panel-2);
    color: var(--chr-soft);
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.chr-icon-btn:hover {
    background: var(--chr-panel-3);
    border-color: var(--chr-line-strong);
    color: var(--chr-text);
}

.chr-icon-btn.is-listening {
    color: #fff;
    border-color: rgba(248, 113, 113, .5);
    background: linear-gradient(140deg, #ef4444, #f97316);
    animation: chrPulse 1.4s infinite;
}

.chr-mode-wrap {
    position: relative;
}

.chr-mode-btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--chr-line);
    border-radius: 12px;
    background: var(--chr-panel-2);
    color: var(--chr-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}

.chr-mode-btn:hover {
    background: var(--chr-panel-3);
    border-color: var(--chr-line-strong);
}

.chr-mode-icon {
    display: grid;
    place-items: center;
    color: var(--chr-accent);
}

.chr-mode-icon svg {
    width: 17px;
    height: 17px;
}

.chr-chevron {
    width: 14px !important;
    height: 14px !important;
    color: var(--chr-muted);
    transition: transform .18s ease;
}

.chr-mode-btn[aria-expanded="true"] .chr-chevron {
    transform: rotate(180deg);
}

.chr-send {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(34, 211, 238, .28);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.chr-send:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 14px 30px rgba(140, 92, 246, .36);
}

.chr-send:active {
    transform: scale(.96);
}

.chr-send svg {
    width: 19px;
    height: 19px;
}

.chr-send .chr-spinner {
    display: none;
}

.chr.is-sending .chr-send svg {
    display: none;
}

.chr.is-sending .chr-send .chr-spinner {
    display: block;
}

/* Popovers */

.chr-pop {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);
    z-index: 30;
    min-width: 248px;
    display: grid;
    gap: 2px;
    padding: 7px;
    border: 1px solid var(--chr-line);
    border-radius: 16px;
    background: var(--chr-panel);
    box-shadow: var(--chr-shadow);
    animation: chrPop .16s ease both;
}

.chr-pop[hidden] {
    display: none;
}

.chr-pop-item {
    width: 100%;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--chr-text);
    text-align: left;
    cursor: pointer;
    transition: background .14s ease;
}

.chr-pop-item:hover {
    background: var(--chr-panel-2);
}

.chr-pop-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: color-mix(in srgb, var(--tone, var(--chr-accent)) 16%, transparent);
    color: var(--tone, var(--chr-accent));
}

.chr-pop-icon svg {
    width: 19px;
    height: 19px;
}

.chr-pop-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.chr-pop-copy b {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.chr-pop-copy small {
    overflow: hidden;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-check {
    display: none;
    color: var(--chr-accent);
    font-size: 13px;
    font-weight: 900;
}

.chr-pop-item.is-selected .chr-check {
    display: block;
}

.chr-pop-item.is-selected {
    background: color-mix(in srgb, var(--chr-accent) 9%, transparent);
}

/* 停用（未隐藏）的模式仍显示，但不可点击 */
.chr-pop-item.is-disabled,
.chr-pop-item:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.chr-pop-item:disabled:hover {
    background: transparent;
}

.chr-mode-menu {
    min-width: 280px;
}

.chr-model-wrap .chr-mode-btn {
    max-width: 300px;
}

.chr-model-label {
    max-width: 236px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-model-menu {
    min-width: 260px;
    max-height: min(320px, 52vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Tone palette */

.chr [data-tone="cyan"] {
    --tone: #22d3ee;
}

.chr [data-tone="violet"] {
    --tone: #a855f7;
}

.chr [data-tone="amber"] {
    --tone: #f59e0b;
}

.chr [data-tone="green"] {
    --tone: #10b981;
}

.chr [data-tone="pink"] {
    --tone: #ec4899;
}

.chr [data-tone="slate"] {
    --tone: #94a3b8;
}

.chr [data-tone="chat"] {
    --tone: #22d3ee;
}

.chr [data-tone="image"] {
    --tone: #a855f7;
}

.chr [data-tone="video"] {
    --tone: #f59e0b;
}

.chr [data-tone="canvas"] {
    --tone: #14b8a6;
}

/* Chips */

.chr-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.chr-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-panel) 78%, transparent);
    color: var(--chr-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.chr-chip:hover {
    color: var(--chr-text);
    border-color: var(--chr-line-strong);
    transform: translateY(-1px);
}

.chr-chip.is-active {
    color: var(--chr-text);
    border-color: color-mix(in srgb, var(--chr-accent) 42%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 12%, var(--chr-panel));
}

/* 停用（未隐藏）的模式快捷入口仍显示，但不可点击 */
.chr-chip:disabled,
.chr-chip.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.chr-chip:disabled:hover {
    color: var(--chr-muted);
    border-color: var(--chr-line);
    transform: none;
}

.chr-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--tone, var(--chr-accent));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--chr-accent)) 18%, transparent);
}

/* Sections */

.chr-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.chr-section-head h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -.01em;
}

.chr-section-head p {
    margin: 4px 0 0;
    color: var(--chr-muted);
    font-size: 12px;
    line-height: 1.5;
}

.chr-section-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--chr-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: color .16s ease;
}

.chr-section-link:hover {
    color: var(--chr-accent);
}

/* Agents */

.chr-agents {
    margin-top: 44px;
    animation: chrRise .6s .1s ease both;
}

/* 停用态：区块照常显示，但卡片与「全部智能体」链接不再响应点击。 */
.chr-agents[data-state="disabled"] {
    cursor: not-allowed;
}

.chr-agents[data-state="disabled"] .chr-agent-card,
.chr-agents[data-state="disabled"] .chr-section-link {
    pointer-events: none;
    cursor: not-allowed;
}

/* 单个智能体被停用：卡片照常显示，但不能进入使用 */
.chr-agent-card.is-disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: .58;
    filter: grayscale(.35);
}

.chr-agent-card.is-disabled::after {
    content: "已停用";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .55);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    letter-spacing: .2px;
}

/* 组合智能体入口卡片：点进去在目标页挑选成员 */
.chr-agent-card--combo .chr-agent-avatar {
    background:
        radial-gradient(120% 120% at 24% 20%, color-mix(in srgb, #6f8cff 40%, transparent), transparent 68%),
        linear-gradient(135deg, rgba(47, 107, 255, .22), rgba(168, 85, 247, .22)),
        var(--chr-panel-3);
}

.chr-agent-card--combo .chr-agent-avatar .chr-agent-initial {
    font-size: 32px;
    font-weight: 700;
}

.chr-agent-card--combo .chr-agent-type {
    color: #8fb0ff;
}

.chr-agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
    gap: 18px;
}

.chr-agent-card {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    overflow: hidden;
    border: 1px solid var(--chr-line);
    border-radius: 22px;
    background: var(--chr-panel);
    box-shadow: var(--chr-shadow-soft);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.chr-agent-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--tone, var(--chr-accent)) 40%, var(--chr-line));
    box-shadow: var(--chr-shadow);
}

.chr-agent-card:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--chr-accent) 60%, transparent);
    outline-offset: 2px;
}

.chr-agent-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(120% 120% at 24% 20%, color-mix(in srgb, var(--tone, var(--chr-accent)) 34%, transparent), transparent 66%),
        var(--chr-panel-3);
    color: var(--chr-text);
}

.chr-agent-avatar img,
.chr-agent-avatar video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    border-radius: inherit;
    pointer-events: none;
    transition: transform .35s ease;
}

.chr-agent-avatar video {
    background: #000;
}

.chr-agent-card:hover .chr-agent-avatar img,
.chr-agent-card:hover .chr-agent-avatar video {
    transform: scale(1.03);
}

.chr-agent-initial {
    font-size: clamp(32px, 2.8vw, 46px);
    font-weight: 800;
    letter-spacing: .02em;
    opacity: .92;
}

.chr-agent-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 12px 6px 5px;
}

.chr-agent-copy strong {
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-agent-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--chr-muted);
    font-size: 12px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chr-agent-type {
    position: absolute;
    right: 18px;
    top: 18px;
    z-index: 2;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--tone, var(--chr-accent)) 34%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-panel) 78%, transparent);
    color: var(--tone, var(--chr-accent));
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* Results */

.chr-results {
    margin-top: 40px;
    animation: chrRise .4s ease both;
}

.chr-results[hidden] {
    display: none;
}

.chr-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 14px;
}

.chr-result-card {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--chr-line);
    border-radius: 18px;
    background: var(--chr-panel);
    box-shadow: var(--chr-shadow-soft);
}

.chr-result-media {
    position: relative;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--chr-panel-3);
    cursor: zoom-in;
}

.chr-result-card[data-kind="video"] .chr-result-media {
    aspect-ratio: 16 / 10;
}

.chr-result-media img,
.chr-result-media video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #050608;
}

.chr-result-card[data-kind="video"] .chr-result-media video {
    object-fit: contain;
}

.chr-result-placeholder {
    display: grid;
    place-items: center;
    gap: 10px;
    color: var(--chr-muted);
    font-size: 12px;
    text-align: center;
}

.chr-result-placeholder.is-error {
    color: #f87171;
}

.chr-result-body {
    display: grid;
    gap: 8px;
    padding: 12px 13px 13px;
}

.chr-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.chr-result-status {
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--chr-panel-3);
    color: var(--chr-soft);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.chr-result-card[data-state="pending"] .chr-result-status {
    background: rgba(245, 158, 11, .14);
    color: #f59e0b;
}

.chr-result-card[data-state="success"] .chr-result-status {
    background: rgba(16, 185, 129, .14);
    color: #10b981;
}

.chr-result-card[data-state="failed"] .chr-result-status {
    background: rgba(239, 68, 68, .14);
    color: #ef4444;
}

.chr-result-model {
    overflow: hidden;
    color: var(--chr-muted);
    font-size: 10px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-result-prompt {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--chr-soft);
    font-size: 12px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.chr-result-error {
    margin: 0;
    color: #f87171;
    font-size: 11px;
    line-height: 1.5;
}

.chr-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.chr-result-actions a,
.chr-result-actions button {
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--chr-line);
    border-radius: 9px;
    background: var(--chr-panel-2);
    color: var(--chr-soft);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.chr-result-actions a:hover,
.chr-result-actions button:hover {
    color: var(--chr-text);
    border-color: var(--chr-line-strong);
    background: var(--chr-panel-3);
}

.chr-result-actions [hidden] {
    display: none;
}

.chr-result-cost {
    margin-left: auto;
    color: var(--chr-muted);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

/* Spinner */

.chr-spinner {
    width: 18px;
    height: 18px;
    display: inline-block;
    border: 2px solid rgba(255, 255, 255, .28);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: chrSpin .8s linear infinite;
}

.chr-result-placeholder .chr-spinner {
    width: 26px;
    height: 26px;
    border-color: var(--chr-line-strong);
    border-top-color: var(--chr-accent);
}

/* Gallery */

.chr-gallery {
    margin-top: 46px;
    padding-bottom: 10px;
}

.chr-gallery-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
}

.chr-gallery-tabs button {
    height: 28px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--chr-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.chr-gallery-tabs button:hover {
    color: var(--chr-text);
}

.chr-gallery-tabs button.is-active {
    background: var(--chr-panel-3);
    color: var(--chr-text);
    box-shadow: inset 0 0 0 1px var(--chr-line);
}

.chr-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    gap: 12px;
}

.chr-gallery-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--chr-line);
    border-radius: 18px;
    background: var(--chr-panel-2);
    cursor: zoom-in;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.chr-gallery-card:hover {
    transform: translateY(-3px);
    border-color: var(--chr-line-strong);
    box-shadow: var(--chr-shadow-soft);
}

.chr-gallery-card img,
.chr-gallery-card video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    pointer-events: none;
    transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.chr-gallery-card:hover img,
.chr-gallery-card:hover video {
    transform: scale(1.045);
}

.chr-gallery-badge {
    position: absolute;
    left: 9px;
    top: 9px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(6, 8, 12, .58);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    backdrop-filter: blur(6px);
}

.chr-gallery-shade {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding: 30px 10px 9px;
    background: linear-gradient(transparent, rgba(4, 6, 10, .82));
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.chr-gallery-shade span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-gallery-shade em {
    flex: 0 0 auto;
    font-style: normal;
    opacity: .82;
}

.chr-gallery-card.is-skeleton {
    border-color: transparent;
    background: linear-gradient(110deg, var(--chr-panel-2) 8%, var(--chr-panel-3) 18%, var(--chr-panel-2) 33%);
    background-size: 220% 100%;
    animation: chrShimmer 1.5s linear infinite;
    cursor: default;
}

.chr-gallery-status {
    min-height: 22px;
    margin-top: 14px;
    color: var(--chr-muted);
    font-size: 12px;
    text-align: center;
}

.chr-gallery-status[hidden] {
    display: none;
}

.chr-gallery-more-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 4px;
}

.chr-gallery-more {
    height: 34px;
    padding: 0 16px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: var(--chr-panel);
    color: var(--chr-soft);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.chr-gallery-more:hover {
    background: var(--chr-panel-2);
    border-color: var(--chr-line-strong);
}

/* Footer */

.chr-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 36px;
    padding: 18px 2px 0;
    border-top: 1px solid var(--chr-line);
    color: var(--chr-muted);
    font-size: 11px;
}

.chr-foot a {
    color: var(--chr-muted);
    transition: color .15s ease;
}

.chr-foot a:hover {
    color: var(--chr-accent);
}

/* Toast */

.chr-toast {
    position: fixed;
    left: 50%;
    bottom: 34px;
    z-index: 100070;
    max-width: calc(100vw - 32px);
    padding: 10px 18px;
    border: 1px solid var(--chr-line-strong);
    border-radius: 999px;
    background: var(--chr-panel-3);
    color: var(--chr-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    box-shadow: var(--chr-shadow);
    transform: translateX(-50%);
    animation: chrToastIn .2s ease both;
}

.chr-toast[hidden] {
    display: none;
}

.chr-toast.is-error {
    border-color: rgba(248, 113, 113, .4);
    color: #fca5a5;
}

/* Lightbox */

.chr-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100060;
    display: grid;
    place-items: center;
    padding: 24px;
}

.chr-lightbox[hidden] {
    display: none;
}

.chr-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: var(--chr-overlay);
    backdrop-filter: blur(10px);
    animation: chrFade .18s ease both;
}

.chr-lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: min(86vh, 860px);
    max-height: min(86dvh, 860px);
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, .82fr);
    overflow: hidden;
    border: 1px solid var(--chr-line);
    border-radius: 24px;
    background: var(--chr-panel);
    box-shadow: var(--chr-shadow);
    animation: chrPop .22s ease both;
}

.chr-lightbox-close {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--chr-line);
    border-radius: 50%;
    background: var(--chr-panel-3);
    color: var(--chr-soft);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.chr-lightbox-close:hover {
    background: var(--chr-panel-2);
    color: var(--chr-text);
}

.chr-lightbox-close svg {
    width: 16px;
    height: 16px;
}

.chr-lightbox-media {
    min-height: 320px;
    max-height: min(86vh, 860px);
    max-height: min(86dvh, 860px);
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #050608;
}

.chr-lightbox-media img,
.chr-lightbox-media video {
    width: 100%;
    height: 100%;
    max-height: min(86vh, 860px);
    max-height: min(86dvh, 860px);
    display: block;
    object-fit: contain;
}

.chr-lightbox-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    overflow-y: auto;
}

.chr-lightbox-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-right: 34px;
}

.chr-lightbox-meta .chr-agent-avatar {
    width: 38px;
    height: 38px;
    aspect-ratio: auto;
    flex: 0 0 auto;
    border-radius: 12px;
}

.chr-lightbox-meta .chr-agent-initial {
    font-size: 15px;
}

.chr-lightbox-meta strong {
    display: block;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-lightbox-meta small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-lightbox-prompt {
    flex: 1 1 auto;
    margin: 0;
    color: var(--chr-soft);
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.chr-lightbox-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    padding-top: 4px;
}

.chr-btn-primary,
.chr-btn-ghost {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.chr-btn-primary {
    border: 0;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #fff;
    box-shadow: 0 10px 24px rgba(34, 211, 238, .22);
}

.chr-btn-ghost {
    border: 1px solid var(--chr-line);
    background: var(--chr-panel-2);
    color: var(--chr-soft);
}

.chr-btn-ghost:hover {
    border-color: var(--chr-line-strong);
    color: var(--chr-text);
}

body.chr-lightbox-open .chr-scroll {
    overflow: hidden;
}

/* In-page conversation */

.chr-chat {
    flex: 1 0 auto;
    padding: 16px 0 10px;
}

.chr-chat[hidden] {
    display: none;
}

.chr-chat-stream {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 4px 0;
}

.chr.is-chatting .chr-scroll {
    display: flex;
    flex-direction: column;
    padding: 0 30px 18px;
}

.chr.is-chatting .chr-hero,
.chr.is-chatting .chr-results,
.chr.is-chatting .chr-agents,
.chr.is-chatting .chr-gallery,
.chr.is-chatting .chr-foot,
.chr.is-chatting .chr-chips {
    display: none;
}

.chr.is-chatting .chr-composer-wrap {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin-top: auto;
    padding: 18px 0 2px;
    background: linear-gradient(180deg, transparent, var(--chr-bg) 42%);
}

.chr-msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
}

.chr-msg.is-user {
    flex-direction: row-reverse;
}

.chr-msg-avatar {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    margin-top: 2px;
    display: grid;
    place-items: center;
    border: 1px solid var(--chr-line-strong);
    border-radius: 50%;
    background: var(--chr-panel-2);
    color: var(--chr-soft);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
}

.chr-msg.is-user .chr-msg-avatar {
    border-color: transparent;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #fff;
}

.chr-msg-bubble {
    min-width: 0;
    max-width: min(720px, calc(100% - 44px));
    padding: 11px 15px 12px;
    border: 1px solid var(--chr-line);
    border-radius: 16px;
    border-top-left-radius: 6px;
    background: color-mix(in srgb, var(--chr-panel) 92%, transparent);
    box-shadow: var(--chr-shadow-soft);
    color: var(--chr-text);
    font-size: 14px;
    line-height: 1.78;
    overflow-wrap: anywhere;
}

.chr-msg.is-user .chr-msg-bubble {
    border-color: transparent;
    border-top-left-radius: 16px;
    border-top-right-radius: 6px;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    box-shadow: 0 12px 28px rgba(34, 211, 238, .18);
    color: #fff;
}

.chr-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.4;
}

.chr-msg-meta b {
    color: var(--chr-soft);
    font-weight: 600;
}

.chr-msg.is-user .chr-msg-meta,
.chr-msg.is-user .chr-msg-meta b {
    color: rgba(255, 255, 255, .82);
}

.chr-msg-copy {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 1px 8px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: transparent;
    color: var(--chr-muted);
    font-family: inherit;
    font-size: 11px;
    line-height: 1.6;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.chr-msg-copy:hover {
    color: var(--chr-text);
    border-color: var(--chr-line-strong);
    background: var(--chr-panel-2);
}

.chr-msg-copy:focus-visible {
    outline: 2px solid var(--chr-accent);
    outline-offset: 1px;
}

.chr-msg-copy.is-copied {
    color: var(--chr-accent);
    border-color: var(--chr-accent);
}

.chr-msg.is-user .chr-msg-copy {
    border-color: rgba(255, 255, 255, .5);
    color: rgba(255, 255, 255, .88);
}

.chr-msg.is-user .chr-msg-copy:hover {
    border-color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.chr-msg.is-user .chr-msg-copy.is-copied {
    color: #fff;
    border-color: #fff;
}

.chr-msg.is-loading .chr-msg-copy {
    display: none;
}

.chr-msg-edit {
    flex: 0 0 auto;
    margin-left: 4px;
    padding: 1px 8px;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: transparent;
    color: var(--chr-muted);
    font-family: inherit;
    font-size: 11px;
    line-height: 1.6;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.chr-msg-edit:hover {
    color: var(--chr-text);
    border-color: var(--chr-line-strong);
    background: var(--chr-panel-2);
}

.chr-msg-edit:focus-visible {
    outline: 2px solid var(--chr-accent);
    outline-offset: 1px;
}

.chr-msg.is-user .chr-msg-edit {
    border-color: rgba(255, 255, 255, .5);
    color: rgba(255, 255, 255, .88);
}

.chr-msg.is-user .chr-msg-edit:hover {
    border-color: rgba(255, 255, 255, .85);
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.chr-msg.is-loading .chr-msg-edit {
    display: none;
}

.chr-msg-body > :first-child {
    margin-top: 0;
}

.chr-msg-body > :last-child {
    margin-bottom: 0;
}

.chr-msg-body p {
    margin: 0 0 10px;
}

.chr-msg-body ul,
.chr-msg-body ol {
    margin: 0 0 10px;
    padding-left: 22px;
}

.chr-msg-body pre {
    max-width: 100%;
    overflow-x: auto;
}

.chr-msg-body img {
    max-width: 100%;
    height: auto;
}

.chr-msg-typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--chr-muted);
}

.chr-msg-typing::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: chrTyping 1s infinite ease-in-out;
}

@keyframes chrTyping {
    0%, 100% {
        opacity: .25;
        transform: scale(.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */

@media (max-height: 620px) {
    .chr-rail {
        gap: 10px;
        padding: 12px 0;
    }

    .chr-rail-nav {
        gap: 6px;
    }

    .chr-rail-btn {
        width: 40px;
        height: 40px;
    }

    .chr-rail-account {
        gap: 6px;
        padding: 0;
    }

    .chr-rail-account-avatar {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
    }

    .chr-rail-account-frame {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 1360px) {
    .chr-agent-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .chr-agent-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }

    .chr-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    }
}

@media (max-width: 760px) {
    .chr {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .chr-history {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 40;
        width: min(84vw, 320px);
        height: 100vh;
        height: 100dvh;
        transform: translateX(-102%);
        border-right: 1px solid var(--chr-line);
        box-shadow: var(--chr-shadow);
        transition: transform .24s ease;
    }

    .chr.is-history-open .chr-history {
        transform: translateX(0);
    }

    .chr-history-backdrop {
        position: fixed;
        inset: 0;
        z-index: 39;
        background: var(--chr-overlay);
    }

    .chr.is-history-open .chr-history-backdrop {
        display: block;
    }

    .chr-history-close {
        display: grid;
    }

    .chr-top-btn {
        width: 38px;
        height: 38px;
    }

    .chr-login-btn {
        height: 36px;
        padding: 0 16px;
        font-size: 12px;
    }

    .chr-rail {
        grid-row: 2;
        grid-column: 1;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-right: 0;
        border-top: 1px solid var(--chr-line);
        background: var(--chr-rail-bg);
    }

    .chr-brand {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .chr-brand img {
        width: 26px;
        height: 26px;
    }

    .chr-rail-nav {
        flex: 1 1 auto;
        flex-direction: row;
        justify-content: space-around;
        gap: 2px;
        padding-top: 0;
    }

    .chr-rail-foot {
        width: auto;
        flex-direction: row;
        gap: 2px;
    }

    .chr-rail-account {
        display: none;
    }

    .chr-rail-btn {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .chr-rail-btn[data-tip]::after {
        display: none;
    }

    .chr-main {
        grid-row: 1;
        grid-column: 1;
        min-height: 0;
        height: auto;
    }

    .chr-top {
        height: 56px;
        padding: 0 14px;
    }

    .chr-scroll {
        padding: 0 14px 26px;
    }

    .chr.is-chatting .chr-scroll {
        padding: 0 14px 14px;
    }

    .chr-chat {
        padding-top: 12px;
    }

    .chr-msg-avatar {
        width: 26px;
        height: 26px;
        font-size: 9px;
    }

    .chr-msg-bubble {
        max-width: calc(100% - 38px);
        padding: 10px 12px;
        font-size: 13.5px;
    }

    .chr-hero {
        padding: 18px 0 20px;
    }

    .chr-hero-brand {
        margin-bottom: 14px;
        font-size: 12px;
    }

    .chr-hero h1 {
        font-size: clamp(25px, 8vw, 32px);
    }

    .chr-hero p {
        margin-top: 10px;
        font-size: 12.5px;
    }

    .chr-composer {
        padding: 12px 12px 10px;
        border-radius: 20px;
    }

    .chr-input {
        min-height: 48px;
        font-size: 15px;
    }

    .chr-chips {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .chr-chips::-webkit-scrollbar {
        display: none;
    }

    .chr-chip {
        flex: 0 0 auto;
    }

    .chr-pop {
        min-width: min(280px, calc(100vw - 40px));
    }

    .chr-mode-menu {
        min-width: min(280px, calc(100vw - 40px));
    }

    .chr-model-menu {
        min-width: min(280px, calc(100vw - 40px));
        max-height: min(300px, 48vh);
    }

    .chr-tool-left {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .chr-model-wrap {
        max-width: 100%;
    }

    .chr-agents,
    .chr-gallery {
        margin-top: 34px;
    }

    .chr-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .chr-agent-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .chr-agent-card {
        padding: 8px;
        border-radius: 18px;
    }

    .chr-agent-avatar {
        border-radius: 14px;
    }

    .chr-agent-copy {
        padding: 9px 4px 4px;
    }

    .chr-agent-copy strong {
        font-size: 13px;
    }

    .chr-agent-copy small {
        -webkit-line-clamp: 1;
    }

    .chr-agent-initial {
        font-size: 28px;
    }

    .chr-agent-type {
        display: none;
    }

    .chr-result-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .chr-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .chr-gallery-card {
        border-radius: 14px;
    }

    .chr-gallery-more-wrap {
        flex-direction: column;
        gap: 10px;
    }

    .chr-lightbox {
        padding: 10px;
    }

    .chr-lightbox-panel {
        grid-template-columns: minmax(0, 1fr);
        max-height: 94vh;
        max-height: 94dvh;
        border-radius: 20px;
    }

    .chr-lightbox-media {
        min-height: 180px;
        max-height: 48vh;
        max-height: 48dvh;
    }

    .chr-lightbox-media img,
    .chr-lightbox-media video {
        max-height: 48vh;
        max-height: 48dvh;
    }

    .chr-lightbox-body {
        padding: 16px;
        gap: 11px;
    }

    .chr-lightbox-prompt {
        font-size: 12px;
        line-height: 1.7;
    }

    .chr-lightbox-close {
        right: 8px;
        top: 8px;
        background: rgba(10, 12, 18, .62);
        color: #fff;
    }

    .chr-foot {
        margin-top: 26px;
        font-size: 10.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chr *,
    .chr *::before,
    .chr *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

@keyframes chrSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes chrRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes chrPop {
    from {
        opacity: 0;
        transform: translateY(6px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chrFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes chrToastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 8px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes chrPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, .34);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

@keyframes chrShimmer {
    from {
        background-position: 120% 0;
    }
    to {
        background-position: -120% 0;
    }
}

/* Home settings decoration */

.chr.has-chr-bg {
    background: transparent;
}

.chr-custom-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: var(--chr-bg);
}

.chr-custom-bg.is-mobile {
    display: none;
}

.chr-main {
    position: relative;
    z-index: 1;
}

.chr-history {
    position: relative;
    z-index: 2;
}

.chr[data-chr-font="sans"] {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

.chr[data-chr-font="serif"] {
    font-family: Georgia, "Songti SC", "Noto Serif SC", "Times New Roman", serif;
}

.chr[data-chr-font="mono"] {
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.chr[data-chr-spacing="compact"] .chr-modules,
.chr[data-chr-spacing="compact"] .chr-carousel,
.chr[data-chr-spacing="compact"] .chr-models {
    margin-top: 20px;
}

.chr[data-chr-spacing="loose"] .chr-modules,
.chr[data-chr-spacing="loose"] .chr-carousel,
.chr[data-chr-spacing="loose"] .chr-models {
    margin-top: 48px;
}

.chr-notice-row {
    display: flex;
    justify-content: center;
    padding-top: 4px;
}

.chr-notice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 8px 14px;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 32%, var(--chr-line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-accent) 10%, var(--chr-panel));
    color: var(--chr-soft);
    font-size: 12.5px;
    line-height: 1.4;
}

.chr-notice > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-notice:hover {
    color: var(--chr-text);
    border-color: color-mix(in srgb, var(--chr-accent) 60%, var(--chr-line));
}

.chr-notice-icon {
    flex: 0 0 auto;
}

.chr-notice-more {
    flex: 0 0 auto;
    color: var(--chr-accent);
}

.chr-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.chr-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 20px;
    border: 1px solid color-mix(in srgb, var(--chr-accent) 46%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 16%, var(--chr-panel));
    color: var(--chr-text);
    font-size: 14px;
    font-weight: 700;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.chr-button img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 5px;
}

.chr-button:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--chr-accent) 72%, var(--chr-line));
}

.chr-button--sm {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
}

.chr-button--lg {
    min-height: 48px;
    padding: 0 28px;
    font-size: 15px;
}

.chr-quick {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.chr-quick-chip {
    max-width: 100%;
    height: auto;
    min-height: 32px;
    padding: 6px 14px;
    text-align: left;
    line-height: 1.35;
    white-space: normal;
}

.chr-modules,
.chr-carousel,
.chr-models {
    margin-top: 34px;
}

.chr-modules-list {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.chr-module-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--chr-line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--chr-panel) 82%, transparent);
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.chr-module-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--chr-accent) 52%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 10%, var(--chr-panel));
}

.chr-module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--chr-accent) 14%, var(--chr-panel-2));
    font-size: 20px;
}

.chr-module-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.chr-module-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.chr-module-copy strong {
    font-size: 14px;
    color: var(--chr-text);
}

.chr-module-copy small {
    color: var(--chr-muted);
    font-size: 12px;
    line-height: 1.4;
}

.chr-module-arrow {
    margin-left: auto;
    color: var(--chr-muted);
    font-size: 15px;
}

.chr-modules[data-layout="list"] .chr-modules-list {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
}

.chr-modules[data-layout="slider"] .chr-modules-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.chr-modules[data-layout="slider"] .chr-module-card {
    flex: 0 0 min(280px, 82vw);
    scroll-snap-align: start;
}

.chr-carousel-nav {
    display: flex;
    gap: 8px;
}

.chr-carousel-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--chr-line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-panel) 86%, transparent);
    color: var(--chr-soft);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.chr-carousel-btn:hover {
    color: var(--chr-text);
    border-color: color-mix(in srgb, var(--chr-accent) 52%, var(--chr-line));
}

.chr-carousel-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.chr-carousel-slide {
    position: relative;
    flex: 0 0 min(420px, 84vw);
    display: block;
    border: 1px solid var(--chr-line);
    border-radius: 18px;
    overflow: hidden;
    background: var(--chr-panel-2);
    scroll-snap-align: start;
}

.chr-carousel-slide img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 160px;
    max-height: 260px;
    object-fit: cover;
}

.chr-carousel-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 14px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, .62), transparent);
    color: #fff;
    font-size: 12.5px;
}

.chr-model-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.chr-model-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--chr-line);
    border-radius: 16px;
    background: color-mix(in srgb, var(--chr-panel) 84%, transparent);
    transition: border-color .16s ease, transform .16s ease;
}

.chr-model-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--chr-accent) 52%, var(--chr-line));
}

.chr-model-card.is-default {
    border-color: color-mix(in srgb, var(--chr-accent) 60%, var(--chr-line));
    background: color-mix(in srgb, var(--chr-accent) 10%, var(--chr-panel));
}

.chr-model-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--chr-accent), var(--chr-accent-2));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.chr-model-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.chr-model-copy strong {
    font-size: 14px;
    color: var(--chr-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-model-copy small {
    color: var(--chr-muted);
    font-size: 12px;
}

.chr-model-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-accent) 18%, transparent);
    color: var(--chr-accent);
    font-size: 11px;
    font-weight: 700;
}

.chr-foot-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Chat image upload */

.chr-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 4px 2px;
}

.chr-attachments[hidden] {
    display: none;
}

.chr-attachment {
    position: relative;
    width: 76px;
    height: 76px;
    border: 1px solid var(--chr-line-strong);
    border-radius: 12px;
    overflow: hidden;
    background: var(--chr-panel-2);
}

.chr-attachment img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chr-attachment-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 5px 3px;
    background: linear-gradient(to top, rgba(0, 0, 0, .66), transparent);
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chr-attachment-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(10, 12, 18, .72);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.chr-attachment-remove:hover {
    background: #ef4444;
}

.chr-attachment-clear {
    align-self: flex-end;
    padding: 4px 10px;
    border: 1px solid var(--chr-line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--chr-muted);
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
}

.chr-attachment-clear:hover {
    color: var(--chr-text);
    border-color: var(--chr-accent);
}

.chr-composer.is-dragover {
    border-color: var(--chr-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--chr-accent) 18%, transparent), var(--chr-shadow);
}

.chr-msg-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.chr-msg-images img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--chr-line);
}

@media (max-width: 760px) {
    .chr.has-chr-bg-mobile .chr-custom-bg:not(.is-mobile) {
        display: none;
    }

    .chr.has-chr-bg-mobile .chr-custom-bg.is-mobile {
        display: block;
    }

    .chr-notice > span:nth-child(2) {
        white-space: normal;
    }

    .chr-carousel-slide {
        flex: 0 0 84vw;
    }

    .chr-attachment {
        width: 64px;
        height: 64px;
    }
}

/* 暂时隐藏大模型对话输入区的「选择智能体」与图片上传入口：结构与脚本保留，后续可恢复或复用到其他页面 */
body.page-chat [data-front-creative-composer="chat"] .front-chat-controls .front-ai-agent-selector,
body.page-chat [data-front-creative-composer="chat"] .front-chat-controls .front-chat-upload {
    display: none !important;
}

/* ==========================================================================
   移动端兜底（手机 / 平板竖屏 / 手机“桌面版网站”模式）
   - 断点与大模型工作台保持一致（≤900px），覆盖 320–430px 常见手机宽度；
   - 强制单列、历史栏抽屉化、底部导航横向滚动，保证不出现横向滚动与错位；
   - 额外用 max-device-width 兜底：手机开启“桌面版网站”时布局宽度会被放大，
     仅靠 max-width 媒体查询不会命中，这里按屏幕宽度再兜一层。
   - 桌面端（>900px）样式不受影响。
   ========================================================================== */

@media (max-width: 900px), (max-device-width: 900px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    html body.page-chat.chr-home {
        overflow: hidden;
    }

    html body.page-chat.chr-home .app-layout,
    html body.page-chat.chr-home .main-area {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        overflow-x: hidden !important;
    }

    html body.page-chat.chr-home .front-creative-menu {
        display: none !important;
    }

    /* 主框架：强制单列，历史栏不再占用列宽 */
    .chr {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .chr-main {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
        height: auto;
    }

    .chr-history {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 40;
        width: min(84vw, 320px);
        max-width: 84vw;
        height: 100vh;
        height: 100dvh;
        transform: translateX(-104%);
        border-right: 1px solid var(--chr-line);
        border-left: 0;
        box-shadow: var(--chr-shadow);
        transition: transform .24s ease;
    }

    .chr.is-history-open .chr-history {
        transform: translateX(0);
    }

    /* 桌面端遗留的“收起历史”状态不应让手机抽屉永久隐藏 */
    .chr.is-history-collapsed .chr-history {
        display: flex;
    }

    .chr-history-backdrop {
        position: fixed;
        inset: 0;
        z-index: 39;
        background: var(--chr-overlay);
    }

    .chr.is-history-open .chr-history-backdrop {
        display: block;
    }

    .chr-history-close {
        display: grid;
    }

    /* 底部导航：横向滑动，按钮不换行、不挤压、不被裁切 */
    .chr-rail {
        grid-row: 2;
        grid-column: 1;
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 0;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-right: 0;
        border-top: 1px solid var(--chr-line);
        background: var(--chr-rail-bg);
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .chr-rail::-webkit-scrollbar {
        display: none;
    }

    .chr-brand {
        flex: 0 0 auto;
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .chr-brand img {
        width: 26px;
        height: 26px;
    }

    .chr-rail-nav {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 2px;
        width: auto;
        min-height: 0;
        padding-top: 0;
    }

    .chr-rail-foot {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 2px;
        width: auto;
    }

    .chr-rail-account {
        display: none;
    }

    .chr-rail-btn {
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .chr-rail-btn[data-tip]::after {
        display: none;
    }

    .chr-top {
        height: 56px;
        padding: 0 14px;
    }

    .chr-login-btn {
        height: 36px;
        padding: 0 16px;
        font-size: 12px;
    }

    .chr-scroll {
        padding: 0 14px calc(26px + env(safe-area-inset-bottom));
    }

    .chr-scroll > * {
        max-width: 100%;
    }

    .chr-hero {
        padding: 16px 0 18px;
    }

    .chr-hero-brand {
        max-width: 100%;
        margin-bottom: 14px;
        font-size: 12px;
    }

    .chr-hero h1 {
        font-size: clamp(24px, 7.6vw, 32px);
        overflow-wrap: anywhere;
    }

    .chr-hero p {
        margin-top: 10px;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .chr-composer {
        border-radius: 22px;
    }

    /* iOS 聚焦时输入字号小于 16px 会放大整页 */
    .chr-input {
        min-height: 46px;
        font-size: 16px;
    }

    .chr-chips {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .chr-chips::-webkit-scrollbar {
        display: none;
    }

    .chr-chip {
        flex: 0 0 auto;
    }

    .chr-pop,
    .chr-mode-menu,
    .chr-model-menu {
        max-width: calc(100vw - 24px);
    }

    .chr-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .chr-modules-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .chr-agent-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .chr-result-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .chr-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .chr-agent-card,
    .chr-gallery-card,
    .chr-module-card,
    .chr-result-card {
        min-width: 0;
        max-width: 100%;
    }

    .chr img,
    .chr video {
        max-width: 100%;
    }

    .chr-notice,
    .chr-notice > span,
    .chr-agent-copy,
    .chr-module-copy,
    .chr-gallery-copy {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .chr-notice > span:nth-child(2) {
        white-space: normal;
    }
}

/* 窄屏手机（320–430px）再收紧一档 */
@media (max-width: 480px) {
    .chr-hero h1 {
        font-size: clamp(23px, 7.8vw, 30px);
    }

    .chr-hero p {
        font-size: 12.5px;
    }

    .chr-agent-grid {
        gap: 10px;
    }

    .chr-gallery-grid {
        gap: 8px;
    }

    .chr-rail-btn {
        width: 40px;
        height: 40px;
    }
}

/* 删除对话确认：站内固定弹层，不使用浏览器原生 confirm */
.chr-confirm-layer {
    position: fixed;
    inset: 0;
    z-index: 100500;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 8, 14, .62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: chrConfirmFade .16s ease both;
}

.chr-confirm {
    width: min(380px, calc(100vw - 32px));
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--chr-line-strong, rgba(255,255,255,.16));
    border-radius: 16px;
    background: var(--chr-panel-2, #1c1f27);
    color: var(--chr-text, #f5f6f8);
    box-shadow: 0 26px 70px rgba(0, 0, 0, .5);
}

.chr-confirm-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(239, 68, 68, .14);
    color: #fca5a5;
    font-size: 17px;
    margin-bottom: 2px;
}

.chr-confirm-title {
    font-size: 15px;
    font-weight: 800;
}

.chr-confirm-text {
    margin: 0;
    color: var(--chr-soft, #c3c8d2);
    font-size: 12.5px;
    line-height: 1.65;
    word-break: break-word;
}

.chr-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.chr-confirm-btn {
    height: 32px;
    padding: 0 15px;
    border: 1px solid var(--chr-line-strong, rgba(255,255,255,.16));
    border-radius: 999px;
    background: transparent;
    color: var(--chr-text, #f5f6f8);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.chr-confirm-btn:hover {
    background: color-mix(in srgb, var(--chr-text) 8%, transparent);
}

.chr-confirm-btn.is-danger {
    border-color: rgba(239, 68, 68, .4);
    background: rgba(239, 68, 68, .16);
    color: #fca5a5;
}

.chr-confirm-btn.is-danger:hover {
    background: rgba(239, 68, 68, .26);
    color: #fecaca;
}

.chr-confirm-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@keyframes chrConfirmFade {
    from { opacity: 0; transform: scale(.98); }
    to { opacity: 1; transform: scale(1); }
}

/* 视频 / 图片面板统一：内容超出时给一条清晰可见、可拖动的滑轨（兼容小屏与手机） */
.dcp-side, .dcp-body,
.vdp-side, .vdp-body,
.ecp-body, .ecp-side {
    scrollbar-width: thin;
    scrollbar-color: var(--chr-line-strong) transparent;
}
.dcp-side::-webkit-scrollbar,
.dcp-body::-webkit-scrollbar,
.vdp-side::-webkit-scrollbar,
.vdp-body::-webkit-scrollbar,
.ecp-body::-webkit-scrollbar,
.ecp-side::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.dcp-side::-webkit-scrollbar-track,
.dcp-body::-webkit-scrollbar-track,
.vdp-side::-webkit-scrollbar-track,
.vdp-body::-webkit-scrollbar-track,
.ecp-body::-webkit-scrollbar-track,
.ecp-side::-webkit-scrollbar-track {
    background: transparent;
}
.dcp-side::-webkit-scrollbar-thumb,
.dcp-body::-webkit-scrollbar-thumb,
.vdp-side::-webkit-scrollbar-thumb,
.vdp-body::-webkit-scrollbar-thumb,
.ecp-body::-webkit-scrollbar-thumb,
.ecp-side::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-line-strong) 88%, transparent);
    background-clip: padding-box;
}
.dcp-side::-webkit-scrollbar-thumb:hover,
.dcp-body::-webkit-scrollbar-thumb:hover,
.vdp-side::-webkit-scrollbar-thumb:hover,
.vdp-body::-webkit-scrollbar-thumb:hover,
.ecp-body::-webkit-scrollbar-thumb:hover,
.ecp-side::-webkit-scrollbar-thumb:hover {
    background: var(--chr-accent);
    background-clip: padding-box;
}

/* 助手头像：显示后台给该对话模型配置的图标（不再固定用默认星环） */
body.page-chat .oc-chat-message.is-assistant .oc-chat-avatar img.oc-chat-model-icon{
  width:28px;
  height:28px;
  border-radius:8px;
  object-fit:contain;
  background:transparent;
}
