:root {
    color-scheme: dark;
    --bg: #0c0d10;
    --sidebar: #111216;
    --surface: #15161b;
    --surface-2: #1a1b21;
    --line: rgba(255, 255, 255, .105);
    --line-strong: rgba(255, 255, 255, .18);
    --text: #f2f2f4;
    --text-soft: #c9c9cf;
    --muted: #85858f;
    --accent: #8b6cff;
    --accent-2: #4f8dff;
    --accent-soft: rgba(139, 108, 255, .16);
    --sidebar-w: 304px;
    --topbar-h: 72px;
    --font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* 字号梯度：全站只允许用这几档，避免 8 / 9 / 10 这种零散值 */
    --t-xxs: 11px;   /* 角标、状态点等极小信息 */
    --t-xs: 12px;    /* 时间、计数、chip */
    --t-sm: 13px;    /* 辅助说明 */
    --t-base: 14px;  /* 正文 */
    --t-md: 15.5px;  /* 卡片标题 */
    --t-lg: 17px;    /* 小节标题 */
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; }
body { overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--t-md); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, textarea { font: inherit; }
a { color: inherit; }
button { border: 0; padding: 0; color: inherit; background: none; cursor: pointer; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid rgba(139, 108, 255, .75); outline-offset: 2px; }
[hidden] { display: none !important; }

.sm-app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); width: 100%; height: 100dvh; background: var(--bg); }

.sm-sidebar { position: relative; z-index: 30; display: flex; min-height: 0; flex-direction: column; padding: 0 18px 14px; border-right: 1px solid var(--line); background: var(--sidebar); }
.sm-brand { display: flex; align-items: center; height: var(--topbar-h); margin: 0 -18px 12px; padding: 0 10px 0 28px; gap: 10px; border-bottom: 1px solid var(--line); text-decoration: none; }
.sm-brand__mark { display: block; width: 32px; height: 32px; object-fit: contain; }
.sm-brand__name { font-size: 20px; font-weight: 720; letter-spacing: -.35px; }

/* 「新建对话」= 侧边栏的主操作，用高对比的实心渐变，和普通导航项拉开层级 */
.sm-new-chat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    overflow: hidden;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, #7c5cff 0%, #6d5bd8 46%, #4f8dff 100%);
    color: #fff;
    text-decoration: none;
    box-shadow:
        0 6px 20px rgba(108, 86, 226, .34),
        inset 0 1px 0 rgba(255, 255, 255, .20);
    transition:
        transform .2s cubic-bezier(.22, .61, .36, 1),
        box-shadow .2s ease,
        filter .2s ease;
}

/* 掠过式高光：悬停时从左扫到右 */
.sm-new-chat::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .34), transparent);
    transform: skewX(-18deg);
    transition: left .58s cubic-bezier(.22, .61, .36, 1);
    pointer-events: none;
}

.sm-new-chat:hover::after {
    left: 118%;
}

.sm-new-chat:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 30px rgba(108, 86, 226, .46),
        inset 0 1px 0 rgba(255, 255, 255, .26);
    filter: saturate(1.08);
}

.sm-new-chat:active {
    transform: translateY(0) scale(.985);
}

/* 加号做成独立胶囊，悬停时旋转 90° */
.sm-new-chat i {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, .22);
    font-size: var(--t-sm);
    transition: transform .3s cubic-bezier(.22, .61, .36, 1), background .2s ease;
}

.sm-new-chat:hover i {
    transform: rotate(90deg);
    background: rgba(255, 255, 255, .32);
}

.sm-new-chat span {
    font-weight: 650;
    letter-spacing: .2px;
}

.sm-new-chat kbd {
    margin-left: auto;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 6px;
    color: rgba(255, 255, 255, .88);
    background: rgba(255, 255, 255, .14);
    font-family: var(--font);
    font-size: var(--t-xxs);
    letter-spacing: .3px;
}

.sm-new-chat:focus-visible {
    outline: 2px solid rgba(124, 92, 255, .85);
    outline-offset: 3px;
}

.sm-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.sm-nav__item { position: relative; display: flex; align-items: center; gap: 13px; width: 100%; height: 44px; padding: 0 14px; border-radius: 8px; color: var(--text-soft); text-align: left; text-decoration: none; transition: color .16s ease, background .16s ease; }
.sm-nav__item::before { position: absolute; top: 8px; bottom: 8px; left: -3px; width: 3px; border-radius: 4px; background: var(--accent); content: ""; opacity: 0; }
.sm-nav__item i { width: 19px; color: #d4d4da; font-size: var(--t-md); text-align: center; }
.sm-nav__item:hover { color: var(--text); background: rgba(255,255,255,.045); }
.sm-nav__item.is-active { color: #fff; background: var(--accent-soft); }
.sm-nav__item.is-active::before { opacity: 1; }
.sm-nav__item.is-active i { color: #e0d7ff; }
.sm-nav__divider { height: 1px; margin: 8px; background: var(--line); }

/*
 * 最近对话区。
 *
 * 侧边栏是「品牌 / 新建对话 / 导航 / 历史 / 账号」纵向堆叠，历史区排在中间。
 * 默认 flex-shrink:1 会让它在窗口变矮时被优先压缩 —— 实测 700px 高时只能显示
 * 4 条，而滚动条很细几乎看不见，用户会误以为「对话记录丢了」。
 * 所以这里做两件事：
 *   1. flex: 1 1 auto —— 让它主动占满剩余空间，而不是被动被压
 *   2. min-height 保底 —— 至少留出约 4 条的可见高度，配合滚动条仍可翻看全部
 */
.sm-history {
    flex: 1 1 auto;
    min-height: 168px;
    margin-top: 14px;
    padding-left: 8px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}
.sm-history h2 { margin: 0 8px 8px 6px; color: var(--muted); font-size: var(--t-sm); font-weight: 520; }
.sm-history button { display: flex; align-items: center; gap: 11px; width: 100%; height: 39px; padding: 0 10px; border-radius: 7px; color: #b8b8bf; text-align: left; transition: background .15s ease, color .15s ease; }
.sm-history button:hover { color: var(--text); background: rgba(255,255,255,.04); }
/*
 * 历史项 vs 导航项：两者含义不同（选中的对话 vs 当前所在模块），
 * 所以视觉上必须能分辨 —— 历史项用「左竖线 + 更淡的底色」，
 * 且与导航项拉开层级缩进，一眼能看出它是 AI 对话 下的子项。
 */
.sm-history button { position: relative; }
.sm-history button::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -2px;
    width: 2px;
    border-radius: 2px;
    background: var(--accent);
    content: "";
    opacity: 0;
    transition: opacity .16s ease;
}
.sm-history button.is-active { color: var(--text); background: rgba(139, 108, 255, .09); }
.sm-history button.is-active::before { opacity: 1; }
.sm-history i { flex: 0 0 auto; width: 16px; color: #a1a1a9; font-size: var(--t-sm); }
.sm-history span { min-width: 0; flex: 1; overflow: hidden; font-size: var(--t-base); text-overflow: ellipsis; white-space: nowrap; }

/* 删除按钮：平时隐形，悬停行或聚焦时才浮现 */
.sm-history__remove {
    width: 18px;
    opacity: 0;
    color: #8b8b94 !important;
    font-size: var(--t-xs) !important;
    text-align: center;
    transition: opacity .15s ease, color .15s ease;
}
.sm-history button:hover .sm-history__remove,
.sm-history button:focus-visible .sm-history__remove { opacity: 1; }
.sm-history__remove:hover { color: #ff8080 !important; }

.sm-history__empty { margin: 2px 10px; color: var(--muted); font-size: var(--t-sm); }

/* 数据层加载失败的提示：用警示色，与「确实没有对话」区分开 */
.sm-history__hint { margin: 2px 10px; color: #d98a3a; font-size: var(--t-sm); }

/* 新加的会话项做个轻微淡入，避免整块列表跳动 */
.sm-history button { animation: sm-history-in .28s cubic-bezier(.22,.61,.36,1) backwards; }
@keyframes sm-history-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* 浅色主题下的历史项 */
body[data-theme="light"] .sm-history button { color: #686870; }
body[data-theme="light"] .sm-history button.is-active { color: #3e326a; background: rgba(118, 87, 232, .07); }
body[data-theme="light"] .sm-history__remove { color: #9a9aa2 !important; }
body[data-theme="light"] .sm-history__remove:hover { color: #d14343 !important; }

.sm-account { position: relative; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.sm-account.is-loading { opacity: .58; }
.sm-account.is-authenticated .sm-avatar { box-shadow: 0 0 0 2px rgba(118,87,232,.12); }
.sm-account.is-guest .sm-avatar { filter: grayscale(.25); opacity: .82; }
.sm-account__main { display: flex; align-items: center; width: 100%; padding: 7px; border-radius: 9px; gap: 10px; text-align: left; transition: background .16s ease; }
.sm-account__main:hover { background: rgba(255,255,255,.045); }
.sm-avatar { display: block; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; object-fit: cover; }
.sm-account__text { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.sm-account__text strong { font-size: var(--t-base); font-weight: 600; }
.sm-account__text small { color: var(--muted); font-size: var(--t-xs); }
.sm-account__main > i { color: var(--muted); font-size: var(--t-sm); }

.sm-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--bg); }
.sm-topbar { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); flex: 0 0 var(--topbar-h); padding: 0 28px 0 16px; border-bottom: 1px solid var(--line); }
.sm-topbar__start, .sm-topbar__end { display: flex; align-items: center; gap: 8px; }
.sm-topbar__end { gap: 2px; }
.sm-topbar__end::before { display: none; }
.sm-select-wrap { position: relative; }
.sm-select { display: flex; align-items: center; min-width: 174px; height: 42px; gap: 9px; padding: 0 9px 0 7px; border: 1px solid transparent; border-radius: 12px; background: rgba(255,255,255,.055); box-shadow: inset 0 0 0 1px rgba(255,255,255,.055), 0 4px 14px rgba(0,0,0,.08); color: var(--text); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.sm-select:hover { border-color: rgba(139,108,255,.25); background: rgba(255,255,255,.075); box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 7px 20px rgba(0,0,0,.12); transform: translateY(-1px); }
.sm-select[aria-expanded="true"] { border-color: rgba(139,108,255,.48); background: var(--surface-2); box-shadow: 0 0 0 3px rgba(139,108,255,.1), 0 8px 22px rgba(0,0,0,.14); }
.sm-select > i:first-child { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 9px; background: rgba(139,108,255,.14); color: #b8a6ff; font-size: 13px; text-align: center; }
.sm-assistant-select .sm-select > i:first-child { background: rgba(79,141,255,.13); color: #8db5ff; }
.sm-select .sm-select__accent { color: #b8a6ff; }
.sm-select span { flex: 1; font-size: 13px; font-weight: 650; letter-spacing: -.1px; text-align: left; }
.sm-select .sm-select__chevron { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 6px; color: var(--muted); font-size: 10px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.sm-select:hover .sm-select__chevron { color: var(--text-soft); background: rgba(255,255,255,.05); }
.sm-select[aria-expanded="true"] .sm-select__chevron { transform: rotate(180deg); }
.sm-icon-button, .sm-mobile-menu { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 9px; color: #d1d1d6; font-size: var(--t-lg); transition: color .16s ease, background .16s ease; }
.sm-icon-button:hover, .sm-mobile-menu:hover { color: #fff; background: rgba(255,255,255,.055); }
.sm-mobile-menu { display: none; }

.sm-popover { position: absolute; z-index: 60; padding: 8px; border: 1px solid var(--line-strong); border-radius: 12px; background: #1a1b20; box-shadow: 0 18px 50px rgba(0,0,0,.42); }
.sm-select-menu { top: calc(100% + 8px); left: 0; width: 276px; }
.sm-select-menu > p { margin: 4px 8px 8px; color: var(--muted); font-size: var(--t-xs); }
.sm-select-menu > .sm-model-menu-empty { margin: 12px 8px 14px; color: var(--muted); font-size: var(--t-xs); text-align: center; }
.sm-select-menu button { display: flex; align-items: center; width: 100%; min-height: 52px; padding: 7px 9px; gap: 11px; border-radius: 8px; text-align: left; transition: background .15s ease; }
.sm-select-menu button:hover, .sm-select-menu button.is-selected { background: rgba(139,108,255,.12); }
.sm-select-menu button > i:first-child { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; background: rgba(255,255,255,.06); color: #b9a9ff; }
.sm-select-menu button > span { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.sm-select-menu strong { font-size: var(--t-sm); font-weight: 600; }
.sm-select-menu small { color: var(--muted); font-size: var(--t-xs); }
.sm-select-menu button > .fa-check { color: var(--accent); font-size: var(--t-xs); }
.sm-menu-separator { height: 1px; margin: 6px; background: var(--line); }
.sm-account-menu { right: 0; bottom: calc(100% + 8px); width: 190px; }
.sm-account-menu button { display: flex; align-items: center; width: 100%; height: 38px; padding: 0 10px; gap: 10px; border-radius: 7px; color: var(--text-soft); text-align: left; }
.sm-account-menu button:hover { color: var(--text); background: rgba(255,255,255,.05); }
.sm-account-menu i { width: 16px; color: var(--muted); text-align: center; }
.sm-account-menu [data-account-action="logout"] { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; color: #d17b7b; }

.sm-workspace { position: relative; display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }
.sm-empty { display: flex; width: min(640px, calc(100% - 64px)); height: 100%; margin: 0 auto; flex-direction: column; justify-content: center; padding-bottom: 224px; }
.sm-empty__heading { margin-bottom: 40px; transform: translateY(-18px); }
.sm-empty h1 { margin: 0; color: #f5f5f6; font-size: clamp(34px, 3.6vw, 44px); font-weight: 660; letter-spacing: -1.4px; line-height: 1.12; }
.sm-empty p { margin: 13px 0 0; color: var(--muted); font-size: var(--t-md); }
.sm-suggestions { display: grid; grid-template-columns: 1fr; }
.sm-suggestions button { display: grid; grid-template-columns: 30px 1fr 24px; align-items: center; min-height: 63px; border-top: 1px solid var(--line); color: var(--text-soft); text-align: left; transition: color .16s ease, background .16s ease, padding .16s ease; }
.sm-suggestions button:last-child { border-bottom: 1px solid var(--line); }
.sm-suggestions button:hover { padding: 0 10px; color: #fff; background: rgba(255,255,255,.025); }
.sm-suggestions button > i:first-child { color: #d8d8de; font-size: var(--t-md); text-align: center; }
.sm-suggestions button > i:last-child { color: #676771; font-size: var(--t-xs); text-align: right; transition: color .16s ease, transform .16s ease; }
.sm-suggestions button:hover > i:last-child { color: var(--accent); transform: translateX(3px); }

.sm-chat { min-height: 0; flex: 1; overflow-y: auto; padding: 40px 0 24px; scrollbar-color: rgba(255,255,255,.13) transparent; }
.sm-chat__inner { width: min(980px, calc(100% - 96px)); margin: 0 auto; }
.sm-question-rail { position: sticky; top: 12px; z-index: 2; height: 0; }
.sm-question-rail nav {
    position: absolute;
    inset-inline-start: 3px;
    display: grid;
    max-height: min(42dvh, 320px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}
.sm-question-rail button { display: grid; width: 20px; height: 16px; place-items: center; }
.sm-question-rail button::before {
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: var(--muted);
    opacity: .55;
    content: "";
}
.sm-question-rail button:is(:hover, :focus-visible, [aria-current])::before {
    width: 12px;
    background: var(--accent);
    opacity: 1;
}
.sm-question-preview {
    position: absolute;
    inset-inline-start: 28px;
    width: min(360px, calc(100% - 40px));
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    color: var(--text);
    font-size: var(--t-sm);
    line-height: 1.5;
    overflow-wrap: anywhere;
    pointer-events: none;
}
.sm-question-preview strong, .sm-question-preview p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}
.sm-question-preview strong { -webkit-line-clamp: 2; }
.sm-question-preview p { margin: 4px 0 0; color: var(--text-soft); -webkit-line-clamp: 3; }
.sm-message { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 28px; }
.sm-message__avatar { display: none; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: #cbbdff; font-size: var(--t-base); }
.sm-message.is-user .sm-message__avatar { background: #27242f; color: #fff; }
.sm-message__body strong { display: block; margin: 3px 0 8px; font-size: var(--t-sm); font-weight: 620; }
.sm-message__body p { margin: 0; color: var(--text-soft); font-size: var(--t-base); line-height: 1.8; white-space: pre-wrap; }
.sm-message.is-user { display: flex; align-items: flex-start; justify-content: flex-end; gap: 11px; margin: 18px 0 30px; }
.sm-message.is-user .sm-message__avatar { order: 2; flex: 0 0 32px; }
.sm-message.is-user .sm-message__body { order: 1; max-width: min(72%, 680px); padding: 11px 16px; border-radius: 18px 18px 5px 18px; background: #f1f1f4; }
.sm-message.is-user .sm-message__body strong { display: none; }
.sm-message.is-user .sm-message__body p { color: #303037; line-height: 1.65; }
.sm-message.is-assistant { margin-bottom: 38px; }
.sm-message.is-assistant .sm-message__body strong { display: none; }
.sm-reply-feedback { display: flex; gap: 4px; margin-top: 10px; }
.sm-reply-feedback button { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--text-soft); }
.sm-reply-feedback button:hover,
.sm-reply-feedback button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.sm-reply-feedback button:disabled { cursor: wait; opacity: .65; }
.sm-followups {
    display: grid;
    width: min(100%, 640px);
    gap: 6px;
    margin: 8px 0 32px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.sm-followups__label {
    margin-bottom: 3px;
    color: var(--text-soft);
    font-size: var(--t-xs);
    font-weight: 600;
}
.sm-followups button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: var(--t-sm);
    line-height: 1.55;
    text-align: start;
    overflow-wrap: anywhere;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.sm-followups button::after {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-inline-end: 3px;
    border: solid var(--accent);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(-45deg);
    content: "";
}
.sm-followups button:hover,
.sm-followups button:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

/* ==================== 消息里的 Markdown 渲染 ====================
 *
 * 聊天页是浅色主题（body[data-theme="light"]），所以这套样式必须按浅色写。
 * 最初按深色写，与 Cherry 自带浅色皮肤互相覆盖，出现了蓝色表格边框、
 * 浅蓝引用底、白底表格这种「半成品」观感 —— 也就是用户看到的「有边框」。
 *
 * 目标：对齐 GPT 网页版的回复样式 —— 无框、无卡片、靠排版与留白区分层级。
 * ================================================================= */

.sm-message__md {
    color: #3f3f46;
    font-size: var(--t-base);
    line-height: 1.8;
}
.sm-message__md strong,
.sm-message__md b { color: #25252b; font-weight: 700; }

/* --- 抹平 Cherry 的编辑器面板外观（投影 / 分栏线 / 内边距） --- */
.sm-message__md .cherry {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}
.sm-message__md .cherry-previewer {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.sm-message__md .cherry-previewer .cherry-markdown,
.sm-message__md .cherry-markdown {
    padding: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Cherry 的隐藏工具面板（取色器、拖拽条等）会渲染出意外线框，统一收掉 */
.sm-message__md .cherry-dropdown,
.sm-message__md .cherry-color-wrap,
.sm-message__md .cherry-toolbar,
.sm-message__md .cherry-drag,
.sm-message__md .cherry-edit-area { display: none !important; }

/* --- 标题：GPT 的层级很克制，行距紧凑、上下留白由段落控制 --- */
.sm-message__md h1,
.sm-message__md h2,
.sm-message__md h3,
.sm-message__md h4,
.sm-message__md h5,
.sm-message__md h6 {
    margin: 22px 0 10px;
    padding: 0;
    border: 0;
    color: #1d1d22;
    font-weight: 650;
    line-height: 1.4;
}
.sm-message__md h1 { font-size: 1.5em; }
.sm-message__md h2 { font-size: 1.3em; }
.sm-message__md h3 { font-size: 1.12em; }
.sm-message__md h4,
.sm-message__md h5,
.sm-message__md h6 { font-size: 1em; }
.sm-message__md > *:first-child,
.sm-message__md .cherry-markdown > *:first-child { margin-top: 0; }

/* --- 段落 --- */
.sm-message__md p {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    color: inherit;
    white-space: normal;
}
.sm-message__md p:last-child { margin-bottom: 0; }

/* --- 列表 --- */
.sm-message__md ul,
.sm-message__md ol { margin: 10px 0 14px; padding-left: 1.5em; border: 0; }
.sm-message__md ul { list-style: disc; }
.sm-message__md ol { list-style: decimal; }
.sm-message__md li { margin: 5px 0; padding: 0; border: 0; color: inherit; }
.sm-message__md li::marker { color: #9a9aa2; }

/* --- 行内代码：GPT 用淡灰底、无边框 --- */
.sm-message__md :not(pre) > code {
    padding: 2px 5px;
    border: 0;
    border-radius: 4px;
    background: rgba(28, 28, 35, .06);
    color: #8b3dff;
    font-family: "Cascadia Code", Consolas, "SF Mono", monospace;
    font-size: .9em;
}

/* --- 代码块：GPT 是浅灰底 + 圆角 + 无描边 --- */
.sm-message__md pre {
    margin: 14px 0;
    padding: 14px 16px;
    overflow-x: auto;
    border: 0;
    border-radius: 10px;
    background: #f5f5f7;
    line-height: 1.7;
}
.sm-message__md pre code {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #33333a;
    font-size: .88em;
}

/* --- 引用：只留左侧竖线，不加底色（Cherry 默认给浅蓝底，要清掉） --- */
.sm-message__md blockquote {
    margin: 14px 0;
    padding: 2px 0 2px 16px;
    border: 0;
    border-left: 3px solid #d4d4da;
    background: transparent;
    color: #5f5f68;
}
.sm-message__md blockquote p { margin: 0 0 6px; }
.sm-message__md blockquote p:last-child { margin-bottom: 0; }

/* --- 表格：GPT 只留横向分隔线，无外框、无竖线、无蓝边 --- */
.sm-message__md table {
    display: block;
    width: 100%;
    margin: 14px 0;
    padding: 0;
    overflow-x: auto;
    border: 0;
    border-collapse: collapse;
    border-spacing: 0;
    border-radius: 0;
    background: transparent;
    font-size: .95em;
}
/*
 * 表格单元格。
 *
 * Cherry 自带的规则是 `.cherry-markdown table th, .cherry-markdown table td
 * { border: 1px solid var(--md-table-border) }`，特异性是「2 类 + 2 元素」。
 * 只用 `.sm-message__md td`（1 类 + 1 元素）压不住它，会出现蓝色边框 ——
 * 也就是用户看到的「模型回答有边框」。所以这里用同等特异性的选择器来覆盖。
 */
.sm-message__md .cherry-markdown table th,
.sm-message__md .cherry-markdown table td,
.sm-message__md table th,
.sm-message__md table td {
    padding: 9px 14px;
    min-width: 0;
    border: 0 !important;
    border-bottom: 1px solid #e8e8ee !important;
    background: transparent !important;
    color: #3f3f46;
    text-align: left;
}
.sm-message__md .cherry-markdown table th,
.sm-message__md table th {
    border-bottom: 1px solid #d9d9e0 !important;
    color: #1d1d22;
    font-weight: 620;
}
.sm-message__md tr:last-child td { border-bottom: 0 !important; }

/* Cherry 还会给表格套一层容器，也要一并去框 */
.sm-message__md .cherry-table-container,
.sm-message__md .cherry-table { border: 0 !important; background: transparent !important; }
.sm-message__md tr:last-child td { border-bottom: 0; }

/* --- 链接 --- */
.sm-message__md a {
    color: #6d4fd6;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
.sm-message__md a:hover { color: #8b5cf6; }

/* --- 分隔线 --- */
.sm-message__md hr { margin: 18px 0; border: 0; border-top: 1px solid #e8e8ee; }

/* --- 图片：限制最大宽度，避免撑破消息区 --- */
.sm-message__md img { max-width: 100%; height: auto; border-radius: 8px; }

/* ==================== 引用来源（联网搜索） ==================== */

/*
 * 来源面板放在正文上方，采用「折叠标题 + 展开列表」的形式。
 * 一次检索常返回多条，全部铺开会把答案推到屏幕外，
 * 用户得先滚过一列链接才看到正文。
 */
.sm-sources { margin: 0 0 12px; }

.sm-sources__head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid #e5e5eb;
    border-radius: 8px;
    background: #fafafc;
    color: #55555e;
    font-size: var(--t-sm);
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease;
}
.sm-sources__head:hover { background: #f4f4f8; border-color: #dcdce4; }
.sm-sources__head i:first-child { color: #6d4fd6; font-size: 12px; }
.sm-sources__chevron {
    margin-left: auto;
    font-size: 10px;
    color: #9a9aa2;
    transition: transform .2s ease;
}
.sm-sources__head.is-open .sm-sources__chevron { transform: rotate(180deg); }

.sm-sources__list {
    margin: 8px 0 0;
    padding: 0 0 0 1.5em;
    list-style: decimal;
}
.sm-sources__list li {
    margin: 0 0 10px;
    color: #6b6b75;
    font-size: .92em;
    line-height: 1.65;
}
.sm-sources__list li::marker { color: #9a9aa2; }
.sm-sources__list a {
    color: #6d4fd6;
    text-decoration: none;
    font-weight: 550;
}
.sm-sources__list a:hover { text-decoration: underline; }
.sm-sources__list p {
    margin: 3px 0 0;
    color: #85858e;
    font-size: .95em;
    /* 摘要最多两行，避免个别长摘要把面板撑得很高 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 深色主题下反向适配（页面目前是浅色，保留以便后续做主题切换） */
body:not([data-theme="light"]) .sm-sources__head {
    border-color: rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .04);
    color: rgba(226, 224, 238, .78);
}
body:not([data-theme="light"]) .sm-sources__head:hover { background: rgba(255, 255, 255, .07); }
body:not([data-theme="light"]) .sm-sources__list li { color: rgba(226, 224, 238, .62); }
body:not([data-theme="light"]) .sm-sources__list p { color: rgba(226, 224, 238, .48); }
body:not([data-theme="light"]) .sm-sources__list a { color: #a78bfa; }

/* Markdown 库没加载出来时的降级：按纯文本显示，保留换行 */
.sm-md-fallback { white-space: pre-wrap; }

/*
 * 流式生成中的光标。
 * 用容器伪元素而不是独立 <span>：Cherry 每次 setMarkdown 会重建内部 DOM，
 * 独立节点会被清掉，而反复重插又会打断它的渲染队列（内容整段渲染不出来）。
 * 伪元素挂在容器上，不受内部重建影响。
 */
.sm-message__md.is-generating::after {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -.15em;
    background: #a78bfa;
    content: "";
    animation: sm-stream-blink .9s steps(1) infinite;
}
@keyframes sm-stream-blink { 50% { opacity: 0; } }

/* 生成失败的消息 */
.sm-message.is-error .sm-message__md { color: #ff9a8f; }

/* 上面已按浅色主题统一定义，此处无需再覆写 */
.sm-typing { display: flex; gap: 4px; padding-top: 8px; }
.sm-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1.1s infinite ease-in-out; }
.sm-typing span:nth-child(2) { animation-delay: .15s; }
.sm-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
/* 打字机标题：左对齐，和下面的副标题、推荐列表保持一致 */
.sm-type-heading { display: flex; min-height: 1.18em; align-items: center; justify-content: flex-start; }
.sm-type-text { display: inline-block; }
.sm-type-cursor { display: inline-block; width: 3px; height: .82em; margin-left: 7px; border-radius: 3px; background: linear-gradient(180deg,#7657e8,#4f8dff); box-shadow: 0 0 10px rgba(118,87,232,.34); animation: sm-type-cursor-blink .82s steps(1,end) infinite; }
@keyframes sm-type-cursor-blink { 0%,46% { opacity: 1; } 47%,100% { opacity: .08; } }

.sm-composer { position: absolute; right: max(34px, calc((100% - 1060px) / 2)); bottom: 68px; left: max(34px, calc((100% - 1060px) / 2)); min-height: 142px; overflow: hidden; padding: 2px; border-radius: 15px; background: rgba(255,255,255,.18); box-shadow: 0 12px 50px rgba(0,0,0,.27); }
.sm-composer__marquee { position: absolute; inset: -110%; background: conic-gradient(from 90deg, transparent 0 17%, rgba(139,108,255,.18) 21%, #8b6cff 26%, #4f8dff 33%, rgba(79,141,255,.15) 38%, transparent 43% 64%, rgba(255,255,255,.18) 68%, rgba(255,255,255,.88) 73%, transparent 79% 100%); filter: saturate(1.15); animation: marquee-spin 3.3s linear infinite; }
@keyframes marquee-spin { to { transform: rotate(360deg); } }
.sm-composer__inner { position: relative; z-index: 1; display: flex; min-height: 138px; flex-direction: column; padding: 17px 16px 13px; border-radius: 13px; background: #17181d; }
.sm-chat:not([hidden]) + .sm-composer { position: relative; inset: auto; flex: 0 0 auto; margin: 0 max(34px, calc((100% - 1060px) / 2)) 68px; }
.sm-composer textarea { width: 100%; min-height: 62px; max-height: 160px; resize: none; overflow-y: auto; border: 0; color: var(--text); background: transparent; font-size: var(--t-base); line-height: 1.65; outline: 0; }
.sm-composer textarea::placeholder { color: #777781; }
.sm-composer__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 12px; }
.sm-chat-skill-dialog {
    width: min(400px, calc(100% - 32px));
    max-height: 80dvh;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
}
.sm-chat-skill-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.sm-chat-skill-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sm-chat-skill-dialog h2 { margin: 0; font-size: var(--t-md); }
.sm-chat-skill-dialog header button { padding: 6px; }
#chatSkillOptions { display: grid; gap: 6px; margin: 14px 0; }
#chatSkillOptions button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; text-align: start; }
#chatSkillOptions button:hover, #chatSkillOptions button[aria-pressed="true"] { background: var(--accent-soft); }
.sm-skill-detail { width: min(880px, calc(100% - 32px)); min-height: min(520px, 80dvh); padding: clamp(18px, 4vw, 34px); }
.sm-skill-detail > header { align-items: flex-start; }
.sm-skill-detail h2 { margin-top: 6px; font-size: clamp(22px, 4vw, 32px); overflow-wrap: anywhere; }
.sm-skill-detail-kicker { color: var(--accent); font-size: var(--t-xs); font-weight: 700; letter-spacing: .08em; }
.sm-skill-detail p { color: var(--text-soft); line-height: 1.65; overflow-wrap: anywhere; }
.sm-skill-detail section { margin-top: 24px; border-top: 1px solid var(--line); }
.sm-skill-version-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.sm-skill-version-row + .sm-skill-version-row { margin-top: 8px; }
.sm-skill-version-row small { color: var(--text-soft); margin-inline-end: auto; }
.sm-skill-version-history { padding: 4px 8px; border-radius: 6px; background: var(--line); color: var(--text-soft); font-size: var(--t-xs); }
.sm-skill-download { display: inline-flex; align-items: center; text-decoration: none; }
#skillPreviewContent { max-height: 320px; overflow: auto; padding: 14px; border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sm-skill-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.sm-skill-detail-actions small { color: var(--text-soft); }
#uploadSkillVersion:disabled { opacity: .52; cursor: not-allowed; }
.sm-skill-detail-link { text-align: start; font: inherit; }
.sm-skill-detail-link:hover { text-decoration: underline; }
.sm-skill-card:has(.sm-skill-detail-link) { cursor: pointer; }
.sm-tools { display: flex; align-items: center; gap: 2px; }
.sm-tools button { display: flex; align-items: center; height: 34px; padding: 0 9px; border-radius: 7px; gap: 7px; color: #bdbdc5; font-size: var(--t-sm); transition: color .15s ease, background .15s ease; }
.sm-tools button:hover { color: #fff; background: rgba(255,255,255,.055); }
.sm-tools i { font-size: var(--t-base); }
/* 聊天页的小开关（按钮里的一颗小胶囊） */
.sm-switch { display: flex; width: 29px; height: 16px; align-items: center; padding: 2px; border-radius: 999px; background: #55565f; transition: background .18s ease; }
.sm-switch span { width: 12px; height: 12px; border-radius: 50%; background: #f3f3f4; transition: transform .18s ease; }
.sm-web-toggle.is-on .sm-switch { background: var(--accent); }
.sm-web-toggle.is-on .sm-switch span { transform: translateX(13px); }
.sm-send { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 10px; background: var(--accent); color: #fff; transition: filter .15s ease, transform .15s ease, opacity .15s ease; }
.sm-send:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.sm-send:disabled { cursor: default; opacity: .36; }

.sm-toast { position: fixed; z-index: 120; top: 88px; right: 28px; display: flex; min-width: 286px; max-width: min(440px,calc(100vw - 32px)); min-height: 64px; align-items: center; padding: 15px 22px 15px 60px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(34,35,41,.96); box-shadow: 0 20px 52px rgba(0,0,0,.3); color: var(--text-soft); font-size: var(--t-base); font-weight: 520; line-height: 1.5; backdrop-filter: blur(16px); animation: sm-toast-enter .22s cubic-bezier(.22,.8,.3,1) both; }
.sm-toast::before { position: absolute; left: 17px; display: grid; width: 30px; height: 30px; place-items: center; content: "✓"; border-radius: 9px; background: rgba(139,108,255,.18); color: #b9a9ff; font-size: 14px; font-weight: 750; }
@keyframes sm-toast-enter { from { opacity: 0; transform: translate3d(18px,-5px,0) scale(.98); } to { opacity: 1; transform: translate3d(0,0,0) scale(1); } }
.sm-sidebar-backdrop { display: none; }

/* About author */
.sm-about-page { overflow: hidden; }
.sm-about-main { background: #f8f8fa; }
.sm-about-topbar { background: rgba(248,248,250,.92); backdrop-filter: blur(18px); }
.sm-page-title { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: var(--t-base); }
.sm-page-title i { font-size: var(--t-xxs); }
.sm-page-title strong { color: var(--text); font-weight: 620; }
.sm-github-link { display: flex; align-items: center; height: 38px; padding: 0 12px; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #37373f; font-size: var(--t-sm); font-weight: 600; text-decoration: none; transition: border-color .16s ease, transform .16s ease; }
.sm-github-link:hover { border-color: rgba(118,87,232,.35); transform: translateY(-1px); }
.sm-github-link .fa-arrow-up-right-from-square { color: #8a8a93; font-size: var(--t-xxs); }
.sm-about-scroll { min-height: 0; flex: 1; overflow-y: auto; scrollbar-color: rgba(28,28,35,.13) transparent; }
/* 一屏铺满的缩放容器：高度由 JS 设定，超出部分裁掉而不是撑出滚动条 */
.sm-about-fit { overflow: hidden; }
.sm-about-content { width: min(1120px, calc(100% - 72px)); margin: 0 auto; padding: 72px 0 48px; }
.sm-profile-layout { display: grid; grid-template-columns: minmax(300px,.72fr) minmax(0,1.28fr); align-items: start; gap: 46px; }
.sm-profile-visual { position: sticky; top: 42px; overflow: hidden; border: 1px solid #1d2340; border-radius: 18px; background: #070913; box-shadow: 0 22px 60px rgba(24,31,70,.16); color: #fff; }
.sm-profile-visual__label { display: flex; align-items: center; justify-content: space-between; height: 54px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.12); color: #9ca9d8; font-size: 9px; letter-spacing: 1.5px; }
.sm-profile-visual__label strong { color: #dbe2ff; font-size: 9px; font-weight: 650; }
.sm-profile-visual img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center; }
.sm-profile-visual__caption { display: flex; min-height: 116px; flex-direction: column; justify-content: center; padding: 18px 22px; border-top: 1px solid rgba(255,255,255,.12); }
.sm-profile-visual__caption span { color: #8092d2; font-size: 8px; font-weight: 700; letter-spacing: 1.6px; }
.sm-profile-visual__caption strong { margin-top: 8px; font-size: 25px; font-weight: 660; letter-spacing: -.6px; }
.sm-profile-visual__caption small { margin-top: 6px; color: #8e96b5; font-family: "Cascadia Code", Consolas, monospace; font-size: 9px; }
.sm-profile-details { min-width: 0; }
.sm-profile-intro { padding: 18px 0 42px; border-bottom: 1px solid #dedee4; }
.sm-profile-intro h1 { margin: 0; color: #18181c; font-size: clamp(58px,6vw,82px); font-weight: 720; letter-spacing: -4px; line-height: .96; }
.sm-author-hero { display: grid; grid-template-columns: minmax(0,1fr) 180px; align-items: end; min-height: 330px; padding: 8px 0 52px; border-bottom: 1px solid #dedee4; }
.sm-eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 28px; color: #6d5ac8; font-size: 12px; font-weight: 750; letter-spacing: 1.8px; }
.sm-eyebrow span { width: 32px; height: 1px; background: #7657e8; }
.sm-author-hero h1 { margin: 0; color: #18181c; font-size: clamp(58px,7vw,92px); font-weight: 720; letter-spacing: -5px; line-height: .94; }
.sm-author-role { margin: 21px 0 0; color: #25252b; font-size: clamp(22px,2.4vw,32px); font-weight: 590; letter-spacing: -.8px; }
.sm-author-summary { max-width: 720px; margin: 22px 0 0; color: #66666f; font-size: 15px; line-height: 1.9; }
.sm-author-typing { display: flex; align-items: center; width: fit-content; min-height: 34px; margin-top: 28px; padding: 0 12px; gap: 9px; border: 1px solid #e0ddec; border-radius: 8px; background: #fff; color: #4e3a9b; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.sm-author-typing i { color: #7657e8; font-size: 10px; }
.sm-author-typing #typingText { transition: opacity .18s ease, transform .18s ease; }
.sm-author-typing #typingText.is-changing { opacity: 0; transform: translateY(3px); }
.sm-caret { width: 1px; height: 15px; background: #7657e8; animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
.sm-author-monogram { position: relative; display: grid; width: 160px; height: 160px; place-items: center; justify-self: end; border: 1px solid #ddd9ed; border-radius: 28px; background: #f1effa; color: #7657e8; overflow: hidden; }
.sm-author-monogram span { font-size: 72px; font-weight: 760; letter-spacing: -6px; }
.sm-author-monogram small { position: absolute; right: 20px; bottom: 18px; z-index: 1; font-size: 10px; font-weight: 750; letter-spacing: 2px; }
.sm-author-stats { display: grid; grid-template-columns: repeat(3,1fr); padding: 28px 0; border-bottom: 1px solid #dedee4; }
.sm-author-stats > div { display: flex; align-items: center; min-height: 58px; padding: 0 28px; gap: 18px; border-right: 1px solid #dedee4; }
.sm-author-stats > div:first-child { padding-left: 0; }
.sm-author-stats > div:last-child { border-right: 0; }
.sm-author-stats > div > span { color: #9a9aa3; font-family: Consolas, monospace; font-size: 12.5px; }
.sm-author-stats p { display: flex; margin: 0; flex-direction: column; gap: 4px; }
.sm-author-stats strong { color: #242429; font-size: 14px; font-weight: 650; }
.sm-author-stats small { color: #85858e; font-size: 12.5px; }
.sm-author-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.8fr); gap: 18px; margin-top: 44px; }
.sm-author-section { border: 1px solid #e0e0e5; border-radius: 16px; background: #fff; }
.sm-project-card, .sm-contact-card { padding: 30px; }
.sm-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.sm-section-heading > div { min-width: 0; }
.sm-section-heading > div > span { color: #8a79d6; font-size: 11px; font-weight: 750; letter-spacing: 1.5px; }
.sm-section-heading h2 { margin: 8px 0 0; color: #202025; font-size: 21px; font-weight: 680; letter-spacing: -.55px; }
.sm-section-heading > p { margin: 10px 0 0; color: #8a8a93; font-size: 12px; }
.sm-status { display: flex; align-items: center; margin-top: 2px; padding: 6px 9px; gap: 6px; border: 1px solid #dfe8df; border-radius: 999px; color: #4e7653; background: #f5faf5; font-size: var(--t-xs); font-weight: 700; letter-spacing: .7px; }
.sm-status i { width: 6px; height: 6px; border-radius: 50%; background: #5ba565; box-shadow: 0 0 0 3px rgba(91,165,101,.12); }
.sm-project-card > p { margin: 22px 0 0; color: #62626b; font-size: var(--t-base); line-height: 1.85; }
.sm-project-card > p + p { margin-top: 13px; }
.sm-project-card strong { color: #333238; font-weight: 650; }
.sm-project-tags { display: flex; flex-wrap: wrap; margin-top: 25px; gap: 8px; }
.sm-project-tags span { padding: 6px 10px; border: 1px solid #e4e0f2; border-radius: 7px; color: #6552b3; background: #faf9fe; font-family: Consolas, monospace; font-size: var(--t-xs); }
.sm-contact-card { display: flex; flex-direction: column; }
.sm-contact-card--wide { margin-top: 34px; padding: 28px 30px; }
.sm-contact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 16px; column-gap: 24px; border-top: 1px solid #ededf0; }
.sm-contact-grid .sm-contact-row:first-of-type { margin-top: 0; }
.sm-contact-row { display: grid; grid-template-columns: 32px minmax(0,1fr) 18px; align-items: center; min-height: 62px; gap: 10px; border-bottom: 1px solid #ededf0; color: #34343a; text-align: left; text-decoration: none; }
.sm-contact-row:first-of-type { margin-top: 15px; }
.sm-contact-row:last-child { border-bottom: 0; }
.sm-contact-row > i:first-child { color: #7657e8; font-size: 15px; text-align: center; }
.sm-contact-row > i:last-child { color: #a2a2aa; font-size: 10px; }
.sm-contact-row > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.sm-contact-row small { color: #94949c; font-size: 11px; }
.sm-contact-row strong { overflow: hidden; color: #3e3e45; font-size: 13px; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.sm-contact-row:hover strong { color: #6047bc; }
.sm-stack-section { margin-top: 18px; padding: 32px; }
.sm-stack-section--compact { padding: 28px 30px; }
.sm-stack-section--compact .sm-stack-groups { grid-template-columns: 1fr; }
.sm-stack-section--compact .sm-stack-group,
.sm-stack-section--compact .sm-stack-group:nth-child(odd),
.sm-stack-section--compact .sm-stack-group:nth-child(even) { grid-column: auto; grid-template-columns: 118px minmax(0,1fr); padding: 17px 0; border-right: 0; }
.sm-stack-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 26px; border-top: 1px solid #ededf0; }
.sm-stack-group { display: grid; grid-template-columns: 128px minmax(0,1fr); padding: 22px 0; border-bottom: 1px solid #ededf0; }
.sm-stack-group:nth-child(odd) { padding-right: 24px; border-right: 1px solid #ededf0; }
.sm-stack-group:nth-child(even) { padding-left: 24px; }
.sm-stack-group:last-child { grid-column: 1 / -1; padding-right: 0; border-right: 0; }
.sm-stack-group h3 { margin: 5px 0 0; color: #686871; font-size: 13px; font-weight: 650; }
.sm-stack-group > div { display: flex; flex-wrap: wrap; gap: 7px; }
.sm-stack-group span { padding: 6px 10px; border-radius: 6px; background: #f3f3f5; color: #505058; font-size: 11.5px; line-height: 1; }
.sm-author-footer { display: flex; align-items: center; justify-content: space-between; padding: 32px 2px 8px; color: #777780; }
.sm-author-footer span { color: #313138; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.sm-author-footer small { font-size: 11.5px; }

/* Reference-inspired profile board */
.sm-about-content.sm-profile-board {
    width: 100%;
    min-height: 100%;
    padding: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
}
.sm-profile-board {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 0;
    border-top: 1px solid #182449;
    border-radius: 0;
    background: #07112d;
    box-shadow: none;

    /* 新增区块统一走这组变量，暗色/浅色各给一套 */
    --pb-card: #10141f;
    --pb-card-border: rgba(151, 174, 235, .18);
    --pb-soft-bg: rgba(124, 147, 220, .12);
    --pb-track: rgba(151, 174, 235, .26);
    --pb-text: #f6f8ff;
    --pb-muted: #8a8a95;
    --pb-accent: #9aaeff;
    --pb-accent-bg: rgba(118, 87, 232, .18);
}
.sm-profile-media { position: sticky; top: 0; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #030611; }
.sm-profile-media__base, .sm-profile-media__orbits { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.sm-profile-media__orbits { position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: screen; opacity: .64; animation: profile-orbits 4.8s ease-in-out infinite alternate; will-change: transform, opacity; }
@keyframes profile-orbits {
    0% { opacity: .38; transform: translate3d(-4%, 1%, 0) scale(1.04); }
    48% { opacity: .82; transform: translate3d(1.5%, -1%, 0) scale(1.08); }
    100% { opacity: .5; transform: translate3d(4%, .5%, 0) scale(1.05); }
}
.sm-profile-board .sm-profile-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto auto;
    column-gap: 26px;
    row-gap: 18px;
    align-content: start;
    padding: 32px 44px 0;
    color: #f6f8ff;
}
/*
 * 第 1 列：简介 + 指标条 + 三个方向
 * 能力链路独占第二行并通栏平铺（六个步骤一行排开，虚线轨道贯穿整行）
 */
.sm-profile-board .sm-profile-col { grid-column: 1; grid-row: 1; display: flex; min-width: 0; flex-direction: column; gap: 22px; }
.sm-profile-board .sm-pillar-section { grid-column: 2 / 4; grid-row: 1; align-self: start; }
.sm-profile-board .sm-pipeline-section { grid-column: 1 / -1; grid-row: 2; align-self: start; }
.sm-profile-board .sm-contact-card--wide { grid-column: 1 / -1; grid-row: 3; }
.sm-profile-board .sm-stack-section { grid-column: 1 / -1; grid-row: 4; align-self: start; }
.sm-profile-board .sm-author-footer { grid-column: 1 / -1; grid-row: 5; align-self: end; }

/* 通栏后正文别被拉成一行太长 */
.sm-profile-board .sm-author-summary { max-width: 780px; }
.sm-profile-board .sm-profile-intro { max-width: 900px; }
.sm-profile-board .sm-profile-intro { padding: 0 0 20px; border-bottom-color: rgba(151,174,235,.18); }
.sm-profile-board .sm-eyebrow { color: #8fa3ff; }
.sm-profile-board .sm-eyebrow span { background: #728cff; }
.sm-profile-board .sm-profile-intro h1 { color: #fff; font-size: clamp(30px,2.9vw,40px); font-weight: 520; letter-spacing: -1.4px; }
.sm-profile-board .sm-profile-intro h1 strong { font-weight: 700; }
.sm-profile-board .sm-author-role { margin-top: 14px; color: #e7ebff; font-size: 18px; }
.sm-profile-board .sm-author-summary { margin-top: 12px; color: #aeb9d7; line-height: 1.7; }
.sm-profile-board .sm-author-typing { min-height: 30px; margin-top: 16px; border-color: rgba(150,170,240,.27); background: rgba(7,14,39,.72); color: #b9c5ff; }
.sm-profile-board .sm-author-stats { padding: 14px 0; border-bottom-color: rgba(151,174,235,.18); }
.sm-profile-board .sm-author-stats > div { min-height: 44px; }
.sm-profile-board .sm-author-stats > div { border-right-color: rgba(151,174,235,.18); }
.sm-profile-board .sm-author-stats > div > span { color: #7584b3; }
.sm-profile-board .sm-author-stats strong { color: #f5f7ff; }
.sm-profile-board .sm-author-stats small { color: #8190b5; }
.sm-profile-board .sm-author-section { border: 0; border-radius: 0; background: transparent; }
.sm-profile-board .sm-contact-card--wide { margin-top: 16px; padding: 0 0 24px; border-bottom: 1px solid rgba(151,174,235,.18); }
.sm-profile-board .sm-contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; column-gap: 20px; }
.sm-profile-board .sm-contact-row { min-height: 52px; }
.sm-profile-board .sm-section-heading > div > span { color: #8ea4ff; }
.sm-profile-board .sm-section-heading h2 { color: #fff; }
.sm-profile-board .sm-section-heading > p { color: #7f8cad; }
.sm-profile-board .sm-contact-grid { border-top-color: rgba(151,174,235,.18); }
.sm-profile-board .sm-contact-row { border-bottom-color: rgba(151,174,235,.14); color: #e8edff; }
.sm-profile-board .sm-contact-row > i:first-child { color: #8aa1ff; }
.sm-profile-board .sm-contact-row > i:last-child { color: #617099; }
.sm-profile-board .sm-contact-row small { color: #7886a9; }
.sm-profile-board .sm-contact-row strong { color: #f4f6ff; }
.sm-profile-board .sm-contact-row:hover strong { color: #b8c6ff; }
.sm-profile-board .sm-stack-section { margin-top: 16px; padding: 0; }
.sm-profile-board .sm-stack-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.sm-profile-board .sm-stack-group { grid-template-columns: 92px minmax(0, 1fr); padding: 9px 0; }
.sm-profile-board .sm-stack-group span { padding: 6px 10px; font-size: 11.5px; }
.sm-profile-board .sm-stack-groups { border-top-color: rgba(151,174,235,.18); }
.sm-profile-board .sm-stack-group,
.sm-profile-board .sm-stack-group:nth-child(odd),
.sm-profile-board .sm-stack-group:nth-child(even) { border-bottom-color: rgba(151,174,235,.14); }
.sm-profile-board .sm-stack-group h3 { color: #9ba8ca; }
.sm-profile-board .sm-stack-group span { background: rgba(124,147,220,.12); color: #d7def5; }
.sm-profile-board .sm-author-footer { padding: 18px 2px 10px; color: #7785aa; }
.sm-profile-board .sm-author-footer span { color: #bac5e4; }

body[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f7f8;
    --sidebar: #efeff1;
    --surface: #ffffff;
    --surface-2: #f5f5f7;
    --line: rgba(28, 28, 35, .09);
    --line-strong: rgba(28, 28, 35, .15);
    --text: #19191d;
    --text-soft: #4f4f57;
    --muted: #7d7d87;
    --accent: #7657e8;
    --accent-2: #4f8dff;
    --accent-soft: rgba(118, 87, 232, .12);
}
body[data-theme="light"] .sm-brand { background: #efeff1; }
/* 浅色主题下保持同一套实心渐变主按钮（不再退回白底描边） */
body[data-theme="light"] .sm-new-chat {
    background: linear-gradient(135deg, #7c5cff 0%, #6d5bd8 46%, #4f8dff 100%);
    box-shadow: 0 6px 20px rgba(108, 86, 226, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
}
body[data-theme="light"] .sm-new-chat:hover {
    box-shadow: 0 12px 30px rgba(108, 86, 226, .38), inset 0 1px 0 rgba(255, 255, 255, .28);
}
body[data-theme="light"] .sm-new-chat kbd {
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .9);
}
body[data-theme="light"] .sm-nav__item { color: #4f4f57; }
body[data-theme="light"] .sm-nav__item i { color: #777780; }
body[data-theme="light"] .sm-nav__item:hover { color: #1d1d22; background: rgba(28,28,35,.045); }
body[data-theme="light"] .sm-nav__item.is-active { color: #3e326a; background: rgba(118,87,232,.13); }
body[data-theme="light"] .sm-nav__item.is-active i { color: #6848dc; }
body[data-theme="light"] .sm-history { scrollbar-color: rgba(28,28,35,.22) transparent; }
body[data-theme="light"] .sm-history button { color: #686870; }
body[data-theme="light"] .sm-history button:hover { color: #202025; background: rgba(28,28,35,.04); }
body[data-theme="light"] .sm-history i { color: #91919a; }
body[data-theme="light"] .sm-account__main:hover { background: rgba(28,28,35,.045); }
body[data-theme="light"] .sm-account__main > i { color: #73737c; }
body[data-theme="light"] .sm-select { background: rgba(255,255,255,.76); box-shadow: inset 0 0 0 1px rgba(28,28,35,.065), 0 5px 16px rgba(35,34,48,.055); }
body[data-theme="light"] .sm-select:hover { border-color: rgba(118,87,232,.19); background: #fff; box-shadow: inset 0 0 0 1px rgba(118,87,232,.08), 0 8px 22px rgba(35,34,48,.09); }
body[data-theme="light"] .sm-select[aria-expanded="true"] { border-color: rgba(118,87,232,.42); background: #fff; box-shadow: 0 0 0 3px rgba(118,87,232,.08), 0 9px 24px rgba(35,34,48,.1); }
body[data-theme="light"] .sm-select > i:first-child { background: #f0ecff; color: #7657e8; }
body[data-theme="light"] .sm-assistant-select .sm-select > i:first-child { background: #edf3ff; color: #4f78c8; }
body[data-theme="light"] .sm-select .sm-select__accent { color: #7657e8; }
body[data-theme="light"] .sm-select .sm-select__chevron { color: #7d7d86; }
body[data-theme="light"] .sm-select:hover .sm-select__chevron { color: #5f4ea0; background: #f3f0fc; }
body[data-theme="light"] .sm-icon-button,
body[data-theme="light"] .sm-mobile-menu { color: #63636c; }
body[data-theme="light"] .sm-icon-button:hover,
body[data-theme="light"] .sm-mobile-menu:hover { color: #202025; background: rgba(28,28,35,.05); }
body[data-theme="light"] .sm-popover { background: #fff; box-shadow: 0 18px 50px rgba(20,20,30,.13); }
body[data-theme="light"] .sm-select-menu button:hover,
body[data-theme="light"] .sm-select-menu button.is-selected { background: rgba(118,87,232,.09); }
body[data-theme="light"] .sm-select-menu button > i:first-child { background: #f2f0fa; color: #6848dc; }
body[data-theme="light"] .sm-account-menu button:hover { color: #19191d; background: rgba(28,28,35,.045); }
body[data-theme="light"] .sm-empty h1 { color: #19191d; }
body[data-theme="light"] .sm-suggestions button:hover { color: #19191d; background: rgba(28,28,35,.025); }
body[data-theme="light"] .sm-suggestions button > i:first-child { color: #707079; }
body[data-theme="light"] .sm-suggestions button > i:last-child { color: #85858e; }
body[data-theme="light"] .sm-message__avatar,
body[data-theme="light"] .sm-message.is-user .sm-message__avatar { background: #f1f1f4; color: #6848dc; }
body[data-theme="light"] .sm-composer { background: rgba(118,87,232,.2); box-shadow: 0 16px 48px rgba(25,25,35,.13), 0 0 0 1px rgba(118,87,232,.05); }
body[data-theme="light"] .sm-composer__marquee { background: conic-gradient(from 90deg, transparent 0 17%, rgba(118,87,232,.18) 21%, #7657e8 26%, #4f8dff 33%, rgba(79,141,255,.16) 38%, transparent 43% 64%, rgba(75,75,88,.14) 68%, rgba(75,75,88,.78) 73%, transparent 79% 100%); filter: saturate(1.25); }
body[data-theme="light"] .sm-composer__inner { background: #fff; }
body[data-theme="light"] .sm-composer textarea::placeholder { color: #777781; }
body[data-theme="light"] .sm-tools button { color: #62626a; }
body[data-theme="light"] .sm-tools button:hover { color: #202025; background: rgba(28,28,35,.05); }
body[data-theme="light"] .sm-switch { background: #8b8b94; }
body[data-theme="light"] .sm-send { box-shadow: 0 5px 16px rgba(118,87,232,.2); }
body[data-theme="light"] .sm-toast { border-color: rgba(118,87,232,.15); background: rgba(255,255,255,.96); box-shadow: 0 18px 45px rgba(35,32,55,.14); color: #45454d; }
body[data-theme="light"] .sm-toast::before { background: #f0ecff; color: #6d4ed8; }

/* ==================== 关于作者 · 浅色版 ==================== */
/*
 * .sm-profile-board 那一组规则是硬编码的深色（暗色主题的覆盖层），
 * 而底层的 .sm-author-* / .sm-section-* 基础规则本身就是浅色配色。
 * 这里把 board 的深色覆盖在 light 主题下还原成浅色，
 * 沿用本文件既有的 body[data-theme="light"] 覆写约定。
 */
body[data-theme="light"] .sm-profile-board {
    background: #fff;
    border-top-color: #e6e6ec;
    --pb-card: #fff;
    --pb-card-border: #e9e6f4;
    --pb-soft-bg: #f7f5fd;
    --pb-track: #dcd7f0;
    --pb-text: #202025;
    --pb-muted: #8a8a93;
    --pb-accent: #7657e8;
    --pb-accent-bg: #f1effa;
}body[data-theme="light"] .sm-profile-board .sm-profile-visual { background: #f2f2f6; border-right-color: #e8e8ee; }
body[data-theme="light"] .sm-profile-board .sm-profile-details { color: #18181c; }
body[data-theme="light"] .sm-profile-board .sm-profile-intro { border-bottom-color: #ececf1; }
body[data-theme="light"] .sm-profile-board .sm-eyebrow { color: #6d5ac8; }
body[data-theme="light"] .sm-profile-board .sm-eyebrow span { background: #7657e8; }
body[data-theme="light"] .sm-profile-board .sm-profile-intro h1 { color: #18181c; }
body[data-theme="light"] .sm-profile-board .sm-author-role { color: #25252b; }
body[data-theme="light"] .sm-profile-board .sm-author-summary { color: #66666f; }
body[data-theme="light"] .sm-profile-board .sm-author-typing { border-color: #e0ddec; background: #fff; color: #4e3a9b; }
body[data-theme="light"] .sm-profile-board .sm-author-stats { border-bottom-color: #ececf1; }
body[data-theme="light"] .sm-profile-board .sm-author-stats > div { border-right-color: #ececf1; }
body[data-theme="light"] .sm-profile-board .sm-author-stats > div > span { color: #9a9aa3; }
body[data-theme="light"] .sm-profile-board .sm-author-stats strong { color: #242429; }
body[data-theme="light"] .sm-profile-board .sm-author-stats small { color: #85858e; }
body[data-theme="light"] .sm-profile-board .sm-contact-card--wide { border-bottom-color: #ececf1; }
body[data-theme="light"] .sm-profile-board .sm-section-heading > div > span { color: #8a79d6; }
body[data-theme="light"] .sm-profile-board .sm-section-heading h2 { color: #202025; }
body[data-theme="light"] .sm-profile-board .sm-section-heading > p { color: #8a8a93; }
body[data-theme="light"] .sm-profile-board .sm-contact-grid { border-top-color: #ededf0; }
body[data-theme="light"] .sm-profile-board .sm-contact-row { border-bottom-color: #ededf0; color: #34343a; }
body[data-theme="light"] .sm-profile-board .sm-contact-row > i:first-child { color: #7657e8; }
body[data-theme="light"] .sm-profile-board .sm-contact-row > i:last-child { color: #a2a2aa; }
body[data-theme="light"] .sm-profile-board .sm-contact-row small { color: #94949c; }
body[data-theme="light"] .sm-profile-board .sm-contact-row strong { color: #3e3e45; }
body[data-theme="light"] .sm-profile-board .sm-stack-groups { border-top-color: #ededf0; }
body[data-theme="light"] .sm-profile-board .sm-stack-group { border-bottom-color: #ededf0; }
body[data-theme="light"] .sm-profile-board .sm-stack-group:nth-child(even) { border-bottom-color: #ededf0; }
body[data-theme="light"] .sm-profile-board .sm-stack-group h3 { color: #686871; }
body[data-theme="light"] .sm-profile-board .sm-stack-group span { background: #f3f3f5; color: #505058; }
body[data-theme="light"] .sm-profile-board .sm-author-footer { color: #777780; }
body[data-theme="light"] .sm-profile-board .sm-author-footer span { color: #313138; }

/* ==================== 新增：指标条 / 能力链路 / 核心能力 ==================== */

/* 指标条 */
.sm-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 22px;
    border: 1px solid var(--pb-card-border);
    border-radius: 14px;
    background: var(--pb-card);
    overflow: hidden;
}
.sm-metrics > div { padding: 13px 14px; border-right: 1px solid var(--pb-card-border); }
.sm-metrics > div:last-child { border-right: 0; }
.sm-metrics b { display: block; font-size: 24px; font-weight: 760; letter-spacing: -1px; line-height: 1.1; color: var(--pb-text); }
.sm-metrics span { display: block; margin-top: 5px; font-size: 12.5px; color: var(--pb-muted); }

/* 能力链路 */
.sm-profile-board .sm-pipeline-section,
.sm-profile-board .sm-pillar-section {
    margin-top: 16px;
    padding: 18px 22px 20px;
    border: 1px solid var(--pb-card-border);
    border-radius: 14px;
    background: var(--pb-card);
}
.sm-pipeline {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}
/* 虚线穿过 34px 节点的垂直中心（17px），并置于节点图标后方。 */
.sm-pipeline::before {
    content: "";
    position: absolute;
    top: 17px;
    /* 六等分网格含 5 个 10px 间距：精确落在首尾节点中心。 */
    left: calc(8.333333% - 4.1667px);
    right: calc(8.333333% - 4.1667px);
    height: 2px;
    z-index: 0;
    background: repeating-linear-gradient(90deg, var(--pb-track) 0 6px, transparent 6px 12px);
    background-position: 0 0;
    pointer-events: none;
    animation: sm-pipeline-flow 1.15s linear infinite;
}

@keyframes sm-pipeline-flow {
    from { background-position: 0 0; }
    to { background-position: 12px 0; }
}
.sm-pipeline__step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}
/*
 * 六步接力点亮：只动 transform 和 opacity（都能走合成层），
 * 辉光用伪元素叠一层，靠 opacity 淡入淡出，不再每帧重绘 box-shadow。
 */
.sm-pipeline__icon {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pb-card);
    border: 1px solid var(--pb-card-border);
    color: var(--pb-accent);
    font-size: 15px;
    box-shadow: 0 6px 16px rgba(118, 87, 232, .10);
    will-change: transform;
    animation: sm-pipeline-beat 2.4s ease-in-out infinite;
    animation-delay: var(--beat-delay, 0s);
}

.sm-pipeline__icon::after {
    content: "";
    position: absolute;
    inset: -7px;
    border-radius: 19px;
    background: radial-gradient(circle at 50% 50%, rgba(124, 92, 237, .55) 0%, rgba(124, 92, 237, 0) 70%);
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    animation: sm-pipeline-glow 2.4s ease-in-out infinite;
    animation-delay: var(--beat-delay, 0s);
}

/* 一次干脆的「跳一下再落回」，比缓慢漂移更利落 */
@keyframes sm-pipeline-beat {
    0%, 100% { transform: scale(1); }
    9% { transform: scale(1.12); }
    20% { transform: scale(1); }
}

@keyframes sm-pipeline-glow {
    0%, 100% { opacity: 0; }
    9% { opacity: 1; }
    20% { opacity: 0; }
}

/* 接力延迟：写在步骤上，图标和它的辉光一起继承 */
.sm-pipeline__step { --beat-delay: 0s; }
.sm-pipeline__step:nth-child(2) { --beat-delay: .2s; }
.sm-pipeline__step:nth-child(3) { --beat-delay: .4s; }
.sm-pipeline__step:nth-child(4) { --beat-delay: .6s; }
.sm-pipeline__step:nth-child(5) { --beat-delay: .8s; }
.sm-pipeline__step:nth-child(6) { --beat-delay: 1s; }
.sm-pipeline__label { margin-top: 7px; font-size: 13.5px; font-weight: 650; color: var(--pb-text); }
.sm-pipeline__sub { font-size: 11.5px; color: var(--pb-muted); }

/* 核心能力 */
.sm-pillar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.sm-profile-board .sm-pillar p { margin-top: 7px; }
.sm-profile-board .sm-pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sm-pillar {
    padding: 17px 17px 19px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--pb-soft-bg);
}
.sm-pillar__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pb-accent-bg);
    color: var(--pb-accent);
    font-size: 14px;
}
.sm-pillar h3 { margin: 13px 0 0; font-size: 14px; font-weight: 680; color: var(--pb-text); }
.sm-pillar p { margin: 8px 0 0; font-size: 13px; line-height: 1.75; color: var(--pb-muted); }

/* 窄屏收敛 */
/* 中屏：三栏太挤，退成两栏 */
@media (max-width: 1500px) {
    .sm-profile-board .sm-profile-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sm-profile-board .sm-profile-col { grid-column: 1; grid-row: 1; }
    .sm-profile-board .sm-pillar-section { grid-column: 2; grid-row: 1; }
    .sm-profile-board .sm-pipeline-section { grid-column: 1 / -1; grid-row: 2; }
    .sm-profile-board .sm-contact-card--wide { grid-column: 1 / -1; grid-row: 3; }
    .sm-profile-board .sm-stack-section { grid-column: 1 / -1; grid-row: 4; }
    .sm-profile-board .sm-author-footer { grid-column: 1 / -1; grid-row: 5; }
}

@media (max-width: 1100px) {
    .sm-pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
    .sm-pipeline::before { display: none; }
    .sm-pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    :root { --sidebar-w: 258px; }

    /* 窄屏单栏：所有区块回到一列 */
    .sm-profile-board .sm-profile-details {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: auto;
    }
    .sm-profile-board .sm-profile-col,
    .sm-profile-board .sm-pillar-section,
    .sm-profile-board .sm-pipeline-section,
    .sm-profile-board .sm-contact-card--wide,
    .sm-profile-board .sm-stack-section,
    .sm-profile-board .sm-author-footer {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    .sm-profile-board .sm-pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm-profile-board .sm-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sm-brand { padding-left: 24px; }
    .sm-profile-layout { grid-template-columns: minmax(250px,.68fr) minmax(0,1.32fr); gap: 28px; }
    .sm-profile-board { grid-template-columns: minmax(260px,.36fr) minmax(0,.64fr); gap: 0; }
    .sm-profile-board .sm-profile-details { padding-right: 30px; padding-left: 30px; }
}

@media (max-width: 800px) {
    :root { --topbar-h: 64px; }
    .sm-app { display: block; }
    .sm-main { height: 100%; }
    .sm-sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(86vw, 300px); transform: translateX(-102%); box-shadow: 18px 0 60px rgba(0,0,0,.38); transition: transform .22s ease; }
    .sm-app.is-sidebar-open .sm-sidebar { transform: translateX(0); }
    .sm-sidebar-backdrop { position: fixed; z-index: 25; inset: 0; width: 100%; height: 100%; background: rgba(0,0,0,.48); }
    .sm-app.is-sidebar-open .sm-sidebar-backdrop { display: block; }
    .sm-mobile-menu { display: grid; }
    .sm-topbar { padding: 0 14px; }
    .sm-topbar__start { gap: 7px; }
    .sm-select { min-width: 0; width: auto; padding: 0 10px; }
    .sm-select span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sm-topbar__end::before { display: none; }
    .sm-empty { width: min(620px, calc(100% - 36px)); padding-bottom: 206px; }
    .sm-empty__heading { margin-bottom: 26px; }
    .sm-empty h1 { font-size: 34px; }
    .sm-empty p { font-size: var(--t-base); }
    .sm-suggestions button { min-height: 57px; }
    .sm-chat__inner { width: calc(100% - 28px); }
    .sm-message.is-user .sm-message__body { max-width: 82%; }
    .sm-composer { right: 14px; bottom: 14px; left: 14px; min-height: 138px; }
    .sm-composer__inner { min-height: 134px; }
    .sm-chat:not([hidden]) + .sm-composer { margin: 0 14px 14px; }
    .sm-about-content { width: min(100% - 34px, 680px); padding-top: 38px; }
    .sm-profile-layout { display: block; }
    .sm-profile-board { display: grid; grid-template-columns: 1fr; }
    .sm-profile-board .sm-profile-visual { margin: 0; border-right: 0; border-bottom: 1px solid rgba(151,174,235,.18); }
    .sm-profile-board .sm-profile-media { position: relative; aspect-ratio: 4 / 4.2; }
    .sm-profile-board .sm-profile-details { padding: 36px 26px 24px; }
    .sm-profile-visual { position: relative; top: auto; display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,.7fr); margin-bottom: 34px; }
    .sm-profile-visual__label { grid-column: 1 / -1; }
    .sm-profile-visual img { aspect-ratio: 4 / 3; }
    .sm-profile-visual__caption { border-top: 0; border-left: 1px solid rgba(255,255,255,.12); }
    .sm-profile-intro { padding-top: 4px; }
    .sm-profile-board .sm-profile-intro { padding-top: 0; }
    .sm-author-hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 36px; }
    .sm-author-monogram { display: none; }
    .sm-author-stats { grid-template-columns: 1fr; }
    .sm-author-stats > div { padding: 14px 0; border-right: 0; border-bottom: 1px solid #e4e4e8; }
    .sm-author-stats > div:last-child { border-bottom: 0; }
    .sm-author-grid { grid-template-columns: 1fr; margin-top: 30px; }
    .sm-stack-groups { grid-template-columns: 1fr; }
    .sm-stack-group, .sm-stack-group:nth-child(odd), .sm-stack-group:nth-child(even) { grid-column: auto; grid-template-columns: 1fr; padding: 18px 0; border-right: 0; gap: 12px; }
    .sm-stack-group h3 { margin: 0; }
    .sm-contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
    .sm-assistant-select { display: none; }
    .sm-topbar__end { gap: 0; }
    .sm-empty { justify-content: flex-start; padding-top: 14vh; }
    .sm-empty h1 { font-size: 31px; }
    .sm-tools button > span:not(.sm-switch) { display: none; }
    .sm-tools button { width: 35px; justify-content: center; padding: 0; }
    .sm-tools .sm-web-toggle { width: auto; padding: 0 5px; }
    .sm-suggestions button { grid-template-columns: 28px 1fr 18px; font-size: var(--t-base); }
    .sm-page-title span, .sm-page-title i, .sm-github-link span, .sm-github-link .fa-arrow-up-right-from-square { display: none; }
    .sm-github-link { width: 38px; padding: 0; justify-content: center; }
    .sm-author-hero h1 { font-size: 56px; letter-spacing: -3.5px; }
    .sm-profile-intro h1 { font-size: 56px; letter-spacing: -3.5px; }
    .sm-author-role { font-size: 22px; }
    .sm-author-summary { font-size: var(--t-base); }
    .sm-author-typing { max-width: 100%; overflow: hidden; white-space: nowrap; }
    .sm-project-card, .sm-contact-card, .sm-stack-section { padding: 23px 20px; }
    .sm-profile-visual { display: block; }
    .sm-about-content.sm-profile-board { width: calc(100% - 24px); padding-top: 24px; }
    .sm-profile-board .sm-profile-media { aspect-ratio: 4 / 4.45; }
    .sm-profile-board .sm-profile-details { padding: 30px 20px 22px; }
    .sm-profile-board .sm-profile-intro h1 { font-size: 34px; letter-spacing: -1.2px; }
    .sm-profile-board .sm-author-role { font-size: 18px; }
    .sm-profile-visual img { aspect-ratio: 4 / 4.35; }
    .sm-profile-visual__caption { min-height: 100px; border-top: 1px solid rgba(255,255,255,.12); border-left: 0; }
    .sm-section-heading { flex-direction: column; }
    .sm-section-heading > p { margin-top: 0; }
    .sm-author-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   各区块自身不再带 margin：行距统一由 grid 的 row-gap 控制，
   这样同一行里的元素（指标条 / 三个方向、简介 / 核心能力）
   顶边才能严格对齐。放在文件末尾确保覆盖前面 board 块里的 margin-top。
   ============================================================ */
.sm-profile-board .sm-metrics,
.sm-profile-board .sm-pillar-section,
.sm-profile-board .sm-pipeline-section,
.sm-profile-board .sm-contact-card--wide,
.sm-profile-board .sm-stack-section { margin-top: 0; }

/* 用户系统里开了「减少动态效果」时，停止流向动画 */
@media (prefers-reduced-motion: reduce) {
    .sm-pipeline::before,
    .sm-pipeline__icon { animation: none; }
}

/* ==================== 模型管理 ==================== */
.sm-models-page { overflow: hidden; }
.sm-models-main { background: #f7f7f9; }
.sm-models-topbar { background: rgba(247,247,249,.94); backdrop-filter: blur(16px); }
.sm-primary-button, .sm-secondary-button { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 15px; border-radius: 9px; gap: 8px; font-size: var(--t-sm); font-weight: 650; transition: transform .16s ease, filter .16s ease, border-color .16s ease; }
.sm-primary-button { background: #7657e8; color: #fff; box-shadow: 0 7px 18px rgba(118,87,232,.18); }
.sm-primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.sm-secondary-button { border: 1px solid rgba(28,28,35,.13); background: #fff; color: #4b4b53; }
.sm-secondary-button:hover { border-color: rgba(118,87,232,.3); color: #6045bf; }
.sm-models-scroll { min-height: 0; flex: 1; overflow-y: auto; scrollbar-color: rgba(28,28,35,.13) transparent; }
.sm-models-content { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding: 52px 0 64px; }
.sm-models-hero { display: flex; min-height: 236px; align-items: center; justify-content: space-between; padding: 42px 44px; gap: 34px; border: 1px solid rgba(28,28,35,.1); border-radius: 18px; background: #fff; }
.sm-models-eyebrow { margin: 0 0 12px; color: #7657e8; font-size: var(--t-sm); font-weight: 760; letter-spacing: 1.6px; }
.sm-models-hero h1 { margin: 0; color: #19191d; font-size: clamp(36px,4vw,52px); font-weight: 720; letter-spacing: -2px; }
.sm-models-hero > div > p:last-child { margin: 13px 0 0; color: #6f6f78; font-size: var(--t-md); line-height: 1.75; }
.sm-model-health { display: flex; min-width: 180px; align-items: flex-start; flex: 0 0 auto; flex-direction: column; padding: 14px 16px; gap: 6px; border: 1px solid rgba(79,145,92,.13); border-radius: 11px; background: rgba(242,249,244,.78); }
.sm-model-health span { display: flex; align-items: center; gap: 8px; color: #3d7046; font-size: var(--t-sm); font-weight: 650; }
.sm-model-health span i { width: 7px; height: 7px; border-radius: 50%; background: #55a867; box-shadow: 0 0 0 4px rgba(85,168,103,.1); }
.sm-model-health small { color: #97979f; font-size: var(--t-sm); }
.sm-model-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 20px 0 38px; overflow: hidden; border: 1px solid rgba(28,28,35,.1); border-radius: 14px; background: #fff; }
.sm-model-metrics article { display: flex; align-items: center; min-height: 92px; padding: 18px 22px; gap: 14px; border-right: 1px solid rgba(28,28,35,.09); }
.sm-model-metrics article:last-child { border-right: 0; }
.sm-model-metrics article > i { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 10px; background: #f1eefc; color: #7657e8; font-size: var(--t-base); }
.sm-model-metrics article > div { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.sm-model-metrics strong { overflow: hidden; color: #222227; font-size: 20px; font-weight: 720; letter-spacing: -.6px; text-overflow: ellipsis; white-space: nowrap; }
.sm-model-metrics span { color: #85858d; font-size: var(--t-sm); }
.sm-model-library__header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 24px; }
.sm-model-library__header h2 { margin: 0; color: #222227; font-size: 20px; font-weight: 680; }
.sm-model-library__header p { margin: 8px 0 0; color: #888890; font-size: var(--t-sm); }
.sm-model-toolbar { display: flex; align-items: center; gap: 10px; }
.sm-model-search { display: flex; align-items: center; width: 210px; height: 38px; padding: 0 11px; gap: 8px; border: 1px solid rgba(28,28,35,.12); border-radius: 9px; background: #fff; color: #85858d; }
.sm-model-search:focus-within { border-color: rgba(118,87,232,.45); box-shadow: 0 0 0 3px rgba(118,87,232,.08); }
.sm-model-search i { font-size: var(--t-sm); }
.sm-model-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #26262b; font: inherit; font-size: var(--t-sm); }
/*
 * 筛选标签 = 分段控件
 * 高亮块由 .sm-filter-indicator 承担并做位移过渡，
 * 按钮本身不再切 font-weight（字重变粗会改变文字宽度，看着会抖）。
 */
.sm-model-filters { position: relative; display: flex; padding: 3px; border: 1px solid rgba(28,28,35,.1); border-radius: 10px; background: #fff; }

.sm-filter-indicator {
    position: absolute;
    top: 3px;
    left: 0;
    height: calc(100% - 6px);
    border-radius: 7px;
    background: linear-gradient(135deg, #f2eefe 0%, #e9e3fd 100%);
    box-shadow: 0 1px 3px rgba(101, 73, 202, .16);
    transition: transform .34s cubic-bezier(.22, .61, .36, 1), width .34s cubic-bezier(.22, .61, .36, 1);
    will-change: transform, width;
    pointer-events: none;
}

.sm-model-filters button {
    position: relative;
    z-index: 1;
    height: 32px;
    padding: 0 13px;
    border-radius: 7px;
    color: #777780;
    font-size: var(--t-sm);
    font-weight: 600;
    transition: color .22s ease;
}

.sm-model-filters button:hover { color: #38383f; }
.sm-model-filters button.is-active { color: #6549ca; }
.sm-model-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.sm-model-card { position: relative; display: flex; min-width: 0; min-height: 330px; flex-direction: column; padding: 22px; border: 1px solid rgba(28,28,35,.1); border-radius: 15px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.sm-model-card:hover { border-color: rgba(118,87,232,.23); box-shadow: 0 14px 38px rgba(25,25,35,.07); transform: translateY(-2px); }
.sm-model-card.is-featured { border-color: rgba(118,87,232,.23); box-shadow: inset 0 3px 0 #7657e8; }
.sm-model-card__top { display: grid; grid-template-columns: 44px minmax(0,1fr) 28px; align-items: center; gap: 12px; }
.sm-model-logo { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 11px; background: #f1eefc; color: #7657e8; font-size: var(--t-base); font-weight: 760; letter-spacing: -.5px; }
.sm-model-logo--shenma { color: #6848dc; }
.sm-model-logo--deepseek { background: #eaf2ff; color: #3b72c8; }
.sm-model-logo--qwen { background: #f1eafe; color: #7546c7; font-size: 18px; }
.sm-model-logo--glm { background: #eaf7f5; color: #258075; font-size: var(--t-xs); letter-spacing: 0; }
.sm-model-logo--bge { background: #fff2e8; color: #b8662d; }
.sm-model-logo--custom { background: #eef2f7; color: #5c6c82; }
.sm-model-card__top > div { min-width: 0; }
.sm-model-card__top h3 { display: flex; align-items: center; min-width: 0; margin: 0; gap: 8px; color: #25252a; font-size: var(--t-md); font-weight: 680; }
.sm-model-card__top h3 em { padding: 3px 7px; border-radius: 5px; background: #eee9ff; color: #6649c6; font-size: var(--t-xs); font-style: normal; font-weight: 650; }
.sm-model-card__top p { overflow: hidden; margin: 6px 0 0; color: #8a8a93; font-size: var(--t-sm); text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 卡片「更多操作」下拉菜单 ---------------- */
.sm-card-menu-pop {
    position: absolute;
    top: 52px;
    right: 14px;
    z-index: 40;
    width: 178px;
    padding: 6px;
    border: 1px solid #e6e6ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(20, 20, 30, .16);
    animation: sm-menu-in .14s ease-out;
}

@keyframes sm-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.sm-card-menu-pop button {
    display: flex;
    align-items: center;
    width: 100%;
    height: 36px;
    padding: 0 11px;
    gap: 10px;
    border-radius: 8px;
    font-size: var(--t-base);
    color: #3d3d44;
    text-align: left;
    transition: background .15s ease, color .15s ease;
}

.sm-card-menu-pop button:hover {
    background: #f5f4fb;
    color: #4c3a9e;
}

.sm-card-menu-pop button > i {
    width: 15px;
    text-align: center;
    font-size: var(--t-xs);
    opacity: .72;
}

.sm-card-menu-pop button.is-danger { color: #c2453f; }
.sm-card-menu-pop button.is-danger:hover { background: #fdf0ef; color: #c2453f; }

.sm-card-menu-sep { height: 1px; margin: 5px 6px; background: #eeeef2; }

/* 暗色主题下的菜单 */
body:not([data-theme="light"]) .sm-card-menu-pop {
    border-color: var(--line-strong);
    background: #1a1b20;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .42);
}
body:not([data-theme="light"]) .sm-card-menu-pop button { color: var(--text-soft); }
body:not([data-theme="light"]) .sm-card-menu-pop button:hover { background: rgba(139, 108, 255, .16); color: #fff; }
body:not([data-theme="light"]) .sm-card-menu-sep { background: var(--line); }

.sm-model-card.is-menu-open { z-index: 30; }
.sm-card-menu { display: grid; width: 28px; height: 28px; flex-shrink: 0; place-items: center; border-radius: 7px; color: #8b8b93; font-size: var(--t-sm); transition: background .15s ease, color .15s ease; }
.sm-card-menu:hover { background: #f3f3f5; color: #4c4c54; }
.sm-card-menu[aria-expanded="true"] { background: #f0edfb; color: #6549ca; }

/* 打开菜单的卡片提层，避免被相邻卡片盖住 */
[data-menu-host].is-menu-open { z-index: 30; }
.sm-model-card__description { min-height: 50px; margin: 18px 0 0; color: #66666f; font-size: var(--t-base); line-height: 1.75; }
.sm-model-tags { display: flex; flex-wrap: wrap; margin-top: 14px; gap: 7px; }
.sm-model-tags span { padding: 6px 10px; border-radius: 5px; background: #f3f3f5; color: #5f5f68; font-size: var(--t-sm); }
.sm-model-card dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 22px 0 0; padding: 15px 0; border-top: 1px solid #ececef; border-bottom: 1px solid #ececef; }
.sm-model-card dl div { min-width: 0; padding: 0 9px; border-right: 1px solid #ececef; }
.sm-model-card dl div:first-child { padding-left: 0; }
.sm-model-card dl div:last-child { padding-right: 0; border-right: 0; }
.sm-model-card dt { color: #93939c; font-size: var(--t-sm); }
.sm-model-card dd { overflow: hidden; margin: 6px 0 0; color: #44444b; font-family: "Cascadia Code", Consolas, monospace; font-size: var(--t-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sm-model-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 16px; }
.sm-model-status { display: flex; align-items: center; gap: 7px; color: #82828b; font-size: var(--t-sm); }
.sm-model-status i { width: 6px; height: 6px; border-radius: 50%; background: #a3a3ab; }
.sm-model-status.is-online { color: #4f7656; }
.sm-model-status.is-online i { background: #58a966; box-shadow: 0 0 0 3px rgba(88,169,102,.1); }
.sm-model-switch { position: relative; display: inline-flex; width: 34px; height: 19px; }
.sm-model-switch input { position: absolute; opacity: 0; pointer-events: none; }
.sm-model-switch > span { width: 34px; height: 19px; padding: 2px; border-radius: 999px; background: #c8c8ce; cursor: pointer; transition: background .16s ease; }
.sm-model-switch > span::after { display: block; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); content: ""; transition: transform .16s ease; }
.sm-model-switch input:checked + span { background: #7657e8; }
.sm-model-switch input:checked + span::after { transform: translateX(15px); }
.sm-model-switch input:focus-visible + span { outline: 2px solid rgba(118,87,232,.55); outline-offset: 2px; }
.sm-add-model-card { display: flex; min-height: 330px; align-items: center; justify-content: center; flex-direction: column; padding: 30px; gap: 9px; border: 1px dashed rgba(118,87,232,.28); border-radius: 15px; background: rgba(118,87,232,.025); color: #7a7a83; text-align: center; transition: border-color .18s ease, background .18s ease; }
.sm-add-model-card:hover { border-color: rgba(118,87,232,.55); background: rgba(118,87,232,.05); }
.sm-add-model-card > i { display: grid; width: 42px; height: 42px; margin-bottom: 5px; place-items: center; border-radius: 12px; background: #eeeafd; color: #7657e8; }
.sm-add-model-card strong { color: #4e4e56; font-size: var(--t-base); }
.sm-add-model-card span { max-width: 240px; color: #8d8d96; font-size: var(--t-xs); line-height: 1.65; }
.sm-model-empty { display: flex; min-height: 280px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: #8d8d95; }
.sm-model-empty i { margin-bottom: 5px; font-size: 22px; }
.sm-model-empty strong { color: #4e4e55; font-size: var(--t-base); }
.sm-model-empty span { font-size: var(--t-sm); }
.sm-dialog-backdrop { position: fixed; z-index: 120; inset: 0; display: grid; padding: 20px; place-items: center; background: rgba(17,17,23,.42); backdrop-filter: blur(4px); }
.sm-dialog { width: min(620px,100%); overflow: hidden; border: 1px solid rgba(28,28,35,.13); border-radius: 16px; background: #fff; box-shadow: 0 28px 90px rgba(20,20,30,.22); }
.sm-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 26px 20px; border-bottom: 1px solid #ececef; }
.sm-dialog > header span { color: #7657e8; font-size: var(--t-xxs); font-weight: 750; letter-spacing: 1.4px; }
.sm-dialog > header h2 { margin: 7px 0 0; color: #242429; font-size: 20px; }
.sm-dialog > header button { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: #777780; }
.sm-dialog > header button:hover { background: #f2f2f4; color: #29292f; }
.sm-dialog form { padding: 24px 26px 26px; }
.sm-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.sm-form-grid label { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.sm-form-grid label.is-wide { grid-column: 1 / -1; }
.sm-form-grid label > span { color: #5d5d65; font-size: var(--t-xs); font-weight: 600; }
.sm-form-grid input, .sm-form-grid select { width: 100%; height: 41px; padding: 0 11px; border: 1px solid rgba(28,28,35,.13); border-radius: 8px; outline: 0; background: #fff; color: #2e2e34; font: inherit; font-size: var(--t-xs); }
.sm-form-grid input:focus, .sm-form-grid select:focus { border-color: rgba(118,87,232,.5); box-shadow: 0 0 0 3px rgba(118,87,232,.08); }

:is(#providerInput, #protocolInput, #typeInput) { cursor: pointer; }

@supports (appearance: base-select) and selector(::picker(select)) {
    :is(#providerInput, #protocolInput, #typeInput),
    :is(#providerInput, #protocolInput, #typeInput)::picker(select) { appearance: base-select; }

    :is(#providerInput, #protocolInput, #typeInput) {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    :is(#providerInput, #protocolInput, #typeInput)::picker-icon {
        color: #776a97;
        transition: rotate .16s ease;
    }
    :is(#providerInput, #protocolInput, #typeInput):open::picker-icon { rotate: 180deg; }

    :is(#providerInput, #protocolInput, #typeInput)::picker(select) {
        max-height: 290px;
        margin: 6px 0;
        padding: 5px;
        overflow-y: auto;
        border: 1px solid #e6e0f3;
        border-radius: 12px;
        background: #fff;
        color: #2e2e34;
        box-shadow: 0 12px 30px rgba(38, 27, 66, .14);
    }

    :is(#providerInput, #protocolInput, #typeInput) option {
        min-height: 34px;
        padding: 7px 10px;
        border-radius: 7px;
        font-size: var(--t-xs);
        cursor: pointer;
    }
    :is(#providerInput, #protocolInput, #typeInput) option:checked { background: #f1ecff; color: #5f41bb; font-weight: 650; }
    :is(#providerInput, #protocolInput, #typeInput) option:hover,
    :is(#providerInput, #protocolInput, #typeInput) option:focus-visible { background: #eee8fd; color: #5136a5; }
    :is(#providerInput, #protocolInput, #typeInput) option::checkmark { order: 1; margin-inline-start: auto; color: #7657e8; }
}
.sm-key-input { position: relative; }
.sm-key-input input { padding-right: 42px; }
.sm-key-input button { position: absolute; top: 0; right: 0; display: grid; width: 40px; height: 41px; place-items: center; color: #888890; font-size: var(--t-xs); }
.sm-form-note { display: flex; align-items: flex-start; margin-top: 18px; padding: 11px 12px; gap: 9px; border-radius: 8px; background: #f6f4fd; color: #6d6685; font-size: var(--t-xxs); line-height: 1.6; }
.sm-form-note i { margin-top: 2px; color: #7657e8; }
.sm-dialog form > footer { display: flex; justify-content: flex-end; margin-top: 24px; gap: 9px; }
body.has-dialog { overflow: hidden; }

@media (max-width: 1180px) {
    .sm-model-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-model-library__header { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 800px) {
    .sm-models-content { width: calc(100% - 30px); padding: 32px 0 44px; }
    .sm-model-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-model-metrics article:nth-child(2) { border-right: 0; }
    .sm-model-metrics article:nth-child(-n+2) { border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-model-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
    .sm-model-search { width: 100%; }
    .sm-model-filters { width: fit-content; }
}

@media (max-width: 580px) {
    .sm-models-topbar .sm-primary-button { width: 40px; padding: 0; }
    .sm-models-topbar .sm-primary-button span { display: none; }
    .sm-models-hero { align-items: flex-start; flex-direction: column; }
    .sm-model-health { align-items: flex-start; }
    .sm-model-metrics { grid-template-columns: 1fr; }
    .sm-model-metrics article { border-right: 0; border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-model-metrics article:last-child { border-bottom: 0; }
    .sm-model-grid { grid-template-columns: 1fr; }
    .sm-model-filters { width: 100%; }
    .sm-model-filters button { flex: 1; padding: 0 6px; }
    .sm-form-grid { grid-template-columns: 1fr; }
    .sm-form-grid label.is-wide { grid-column: auto; }
    .sm-dialog form, .sm-dialog > header { padding-right: 20px; padding-left: 20px; }
}

/* ==================== 知识库 ==================== */
.sm-knowledge-page { overflow: hidden; }
.sm-kb-main { background: #f7f7f9; }
.sm-kb-topbar { background: rgba(247,247,249,.94); backdrop-filter: blur(16px); }
.sm-kb-top-actions { display: flex; align-items: center; gap: 9px; }
.sm-kb-scroll { min-height: 0; flex: 1; overflow-y: auto; scrollbar-color: rgba(28,28,35,.13) transparent; }
.sm-kb-content { width: min(1240px,calc(100% - 64px)); margin: 0 auto; padding: 52px 0 64px; }
.sm-kb-hero { display: flex; min-height: 236px; align-items: center; justify-content: space-between; padding: 42px 44px; gap: 34px; border: 1px solid rgba(28,28,35,.1); border-radius: 18px; background: #fff; }
.sm-kb-eyebrow { margin: 0 0 12px; color: #7657e8; font-size: var(--t-sm); font-weight: 760; letter-spacing: 1.6px; }
.sm-kb-hero h1 { margin: 0; color: #19191d; font-size: clamp(36px,4vw,52px); font-weight: 720; letter-spacing: -2px; }
.sm-kb-hero > div > p:last-child { margin: 13px 0 0; color: #6f6f78; font-size: var(--t-base); line-height: 1.75; }
.sm-kb-sync { display: flex; min-width: 180px; align-items: flex-start; flex: 0 0 auto; flex-direction: column; padding: 14px 16px; gap: 6px; border: 1px solid rgba(79,145,92,.13); border-radius: 11px; background: rgba(242,249,244,.78); }
.sm-kb-sync span { display: flex; align-items: center; gap: 8px; color: #3d7046; font-size: var(--t-sm); font-weight: 650; }
.sm-kb-sync span i { width: 7px; height: 7px; border-radius: 50%; background: #55a867; box-shadow: 0 0 0 4px rgba(85,168,103,.1); }
.sm-kb-sync small { color: #97979f; font-size: var(--t-sm); }
.sm-kb-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 20px 0 38px; overflow: hidden; border: 1px solid rgba(28,28,35,.1); border-radius: 14px; background: #fff; }
.sm-kb-metrics article { display: flex; align-items: center; min-height: 92px; padding: 18px 22px; gap: 14px; border-right: 1px solid rgba(28,28,35,.09); }
.sm-kb-metrics article:last-child { border-right: 0; }
.sm-kb-metrics article > i { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 10px; background: #f1eefc; color: #7657e8; font-size: var(--t-base); }
.sm-kb-metrics article > div { display: flex; flex-direction: column; gap: 4px; }
.sm-kb-metrics strong { color: #222227; font-size: 20px; font-weight: 720; letter-spacing: -.6px; }
.sm-kb-metrics span { color: #85858d; font-size: var(--t-sm); }
.sm-kb-library__header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 24px; }
.sm-kb-library__header h2 { margin: 0; color: #222227; font-size: 20px; font-weight: 680; }
.sm-kb-library__header p { margin: 8px 0 0; color: #888890; font-size: var(--t-sm); }
.sm-kb-toolbar { display: flex; align-items: center; gap: 10px; }
.sm-kb-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.sm-kb-card { display: flex; min-width: 0; min-height: 292px; flex-direction: column; padding: 22px; border: 1px solid rgba(28,28,35,.1); border-radius: 15px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.sm-kb-card:hover { border-color: rgba(118,87,232,.23); box-shadow: 0 14px 38px rgba(25,25,35,.07); transform: translateY(-2px); }
.sm-kb-card__top { display: grid; grid-template-columns: 42px minmax(0,1fr) 28px; align-items: center; gap: 12px; }
.sm-kb-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; background: #f0edfc; color: #7657e8; font-size: var(--t-base); }
.sm-kb-icon--orange { background: #fff1e8; color: #bb642b; }
.sm-kb-icon--blue { background: #eaf2ff; color: #3d70c4; }
.sm-kb-icon--green { background: #eaf7f1; color: #348261; }
.sm-kb-icon--pink { background: #fcecf4; color: #b74f83; }
.sm-kb-icon--gray { background: #eff1f4; color: #68707e; }
.sm-kb-card__top > div { min-width: 0; }
.sm-kb-card__top h3 { display: flex; align-items: center; margin: 0; gap: 7px; color: #25252a; font-size: var(--t-md); font-weight: 680; }
.sm-kb-card__top h3 em { color: #8b8b94; font-size: var(--t-xs); font-style: normal; }
.sm-kb-card__top p { overflow: hidden; margin: 6px 0 0; color: #8a8a93; font-size: var(--t-sm); text-overflow: ellipsis; white-space: nowrap; }

.sm-kb-card__top > button:hover { background: #f3f3f5; color: #4c4c54; }
.sm-kb-card__stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 24px; padding: 15px 0; border-top: 1px solid #ececef; border-bottom: 1px solid #ececef; }
.sm-kb-card__stats span { display: flex; align-items: baseline; justify-content: center; gap: 4px; border-right: 1px solid #ececef; color: #92929a; font-size: var(--t-xs); }
.sm-kb-card__stats span:last-child { border-right: 0; }
.sm-kb-card__stats strong { color: #414148; font-size: var(--t-base); font-weight: 680; }
.sm-kb-progress { margin-top: 20px; }
.sm-kb-progress > div { display: flex; align-items: center; justify-content: space-between; color: #8a8a92; font-size: var(--t-xs); }
.sm-kb-progress > div strong { color: #5d5d65; font-size: var(--t-xs); }
.sm-kb-progress > i { display: block; height: 5px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #ededf1; }
.sm-kb-progress > i span { display: block; height: 100%; border-radius: inherit; background: #7657e8; }
.sm-kb-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 20px; }
.sm-kb-state { display: flex; align-items: center; gap: 7px; color: #8a8a92; font-size: var(--t-xs); }
.sm-kb-state i { width: 6px; height: 6px; border-radius: 50%; background: #a3a3ab; }
.sm-kb-state.is-ready { color: #4f7656; }
.sm-kb-state.is-ready i { background: #58a966; box-shadow: 0 0 0 3px rgba(88,169,102,.1); }
.sm-kb-state.is-syncing { color: #8c6a2f; }
.sm-kb-state.is-syncing i { background: #d69b3b; animation: kb-pulse 1.4s ease-in-out infinite; }
@keyframes kb-pulse { 50% { opacity: .35; } }
.sm-kb-card__footer time { color: #a0a0a8; font-size: var(--t-xs); }
.sm-add-kb-card { display: flex; min-height: 292px; align-items: center; justify-content: center; flex-direction: column; padding: 30px; gap: 9px; border: 1px dashed rgba(118,87,232,.28); border-radius: 15px; background: rgba(118,87,232,.025); color: #7a7a83; text-align: center; }
.sm-add-kb-card:hover { border-color: rgba(118,87,232,.55); background: rgba(118,87,232,.05); }
.sm-add-kb-card > i { display: grid; width: 42px; height: 42px; margin-bottom: 5px; place-items: center; border-radius: 12px; background: #eeeafd; color: #7657e8; }
.sm-add-kb-card strong { color: #4e4e56; font-size: var(--t-sm); }
.sm-add-kb-card span { color: #97979f; font-size: var(--t-xxs); }

@media (max-width: 1180px) {
    .sm-kb-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-kb-library__header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 800px) {
    .sm-kb-content { width: calc(100% - 30px); padding: 32px 0 44px; }
    .sm-kb-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-kb-metrics article:nth-child(2) { border-right: 0; }
    .sm-kb-metrics article:nth-child(-n+2) { border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-kb-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
    .sm-kb-toolbar .sm-model-search { width: 100%; }
}
@media (max-width: 580px) {
    .sm-kb-top-actions .sm-secondary-button { display: none; }
    .sm-kb-top-actions .sm-primary-button { width: 40px; padding: 0; }
    .sm-kb-top-actions .sm-primary-button span { display: none; }
    .sm-kb-hero { align-items: flex-start; flex-direction: column; }
    .sm-kb-sync { align-items: flex-start; }
    .sm-kb-metrics { grid-template-columns: 1fr; }
    .sm-kb-metrics article { border-right: 0; border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-kb-metrics article:last-child { border-bottom: 0; }
    .sm-kb-grid { grid-template-columns: 1fr; }
    .sm-kb-toolbar .sm-model-filters { width: 100%; }
    .sm-kb-toolbar .sm-model-filters button { flex: 1; padding: 0 6px; }
}

/* ==================== Skill 市场 ==================== */
.sm-skills-page { overflow: hidden; }
.sm-skills-main { background: #f7f7f9; }
.sm-skills-topbar { background: rgba(247,247,249,.94); backdrop-filter: blur(16px); }
.sm-skills-scroll { min-height: 0; flex: 1; overflow-y: auto; scrollbar-color: rgba(28,28,35,.13) transparent; }
.sm-skills-content { width: min(1240px,calc(100% - 64px)); margin: 0 auto; padding: 42px 0 64px; }
.sm-skills-hero { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.65fr); overflow: hidden; border: 1px solid rgba(28,28,35,.1); border-radius: 18px; background: #fff; }
.sm-skills-hero > div:first-child { padding: 43px 44px 40px; }
.sm-skills-eyebrow { margin: 0 0 14px; color: #7657e8; font-size: var(--t-sm); font-weight: 760; letter-spacing: 1.6px; }
.sm-skills-hero h1 { max-width: 650px; margin: 0; color: #19191d; font-size: clamp(38px,4.2vw,58px); font-weight: 720; letter-spacing: -2.4px; line-height: 1.08; }
.sm-skills-hero > div:first-child > p:nth-of-type(2) { max-width: 680px; margin: 17px 0 0; color: #6f6f78; font-size: var(--t-base); line-height: 1.8; }
.sm-skills-hero__actions { display: flex; margin-top: 27px; gap: 9px; }
.sm-skills-feature { position: relative; display: flex; min-height: 280px; justify-content: center; flex-direction: column; padding: 36px; overflow: hidden; border-left: 1px solid rgba(118,87,232,.13); background: #f2effc; }
.sm-skills-feature > i { display: grid; width: 48px; height: 48px; margin-bottom: 22px; place-items: center; border-radius: 13px; background: #7657e8; box-shadow: 0 12px 28px rgba(118,87,232,.22); color: #fff; font-size: var(--t-lg); }
.sm-skills-feature h2 { margin: 0; color: #26242f; font-size: 22px; font-weight: 700; letter-spacing: -.7px; }
.sm-skills-feature p { margin: 10px 0 0; color: #6d687d; font-size: var(--t-sm); }
.sm-skills-feature small { margin-top: 24px; color: #877ca9; font-size: var(--t-xs); }
.sm-skills-feature__badge { position: absolute; top: 22px; right: 22px; display: flex; align-items: center; padding: 6px 8px; gap: 5px; border-radius: 999px; background: rgba(255,255,255,.7); color: #674cc2; font-size: var(--t-xxs); font-weight: 750; letter-spacing: .7px; }
.sm-skill-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 20px 0 38px; overflow: hidden; border: 1px solid rgba(28,28,35,.1); border-radius: 14px; background: #fff; }
.sm-skill-metrics article { min-height: 78px; padding: 17px 22px; border-right: 1px solid rgba(28,28,35,.09); }
.sm-skill-metrics article:last-child { border-right: 0; }
.sm-skill-metrics strong { display: block; color: #242429; font-size: 21px; font-weight: 720; letter-spacing: -.7px; }
.sm-skill-metrics span { display: block; margin-top: 5px; color: #85858d; font-size: var(--t-sm); }
.sm-skill-market__header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 24px; }
.sm-skill-market__header h2 { margin: 0; color: #222227; font-size: 20px; font-weight: 680; }
.sm-skill-market__header p { margin: 8px 0 0; color: #888890; font-size: var(--t-sm); }
.sm-skill-toolbar { display: flex; align-items: center; gap: 10px; }
.sm-skill-toolbar .sm-model-search { width: 250px; }
.sm-skill-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.sm-skill-card { display: flex; min-width: 0; min-height: 336px; flex-direction: column; padding: 22px; border: 1px solid rgba(28,28,35,.1); border-radius: 15px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.sm-skill-card:hover { border-color: rgba(118,87,232,.23); box-shadow: 0 14px 38px rgba(25,25,35,.07); transform: translateY(-2px); }
.sm-skill-card.is-featured { border-color: rgba(118,87,232,.23); box-shadow: inset 0 3px 0 #7657e8; }
.sm-skill-card__top { display: grid; grid-template-columns: 42px minmax(0,1fr) 28px; align-items: start; gap: 10px; }
.sm-skill-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; font-size: var(--t-base); }
.sm-skill-icon--purple { background: #f0edfc; color: #7657e8; }
.sm-skill-icon--blue { background: #eaf2ff; color: #3970c9; }
.sm-skill-icon--green { background: #eaf7f1; color: #33815f; }
.sm-skill-icon--orange { background: #fff1e8; color: #bc642c; }
.sm-skill-icon--dark { background: #eef0f4; color: #535b69; }
.sm-skill-icon--pink { background: #fcecf4; color: #b84f84; }
.sm-skill-badge { width: fit-content; margin-top: 2px; padding: 5px 8px; border-radius: 6px; background: #f0ecff; color: #6548c7; font-size: var(--t-xs); font-weight: 680; }
.sm-skill-badge.is-community { background: #fff1df; color: #a86422; }
.sm-skill-badge.is-new { background: #e9f7ef; color: #3c7d58; }

.sm-skill-card__top > button:hover { background: #f3f3f5; color: #4c4c54; }
.sm-skill-card > h3 { margin: 18px 0 0; color: #25252a; font-size: var(--t-md); font-weight: 690; }
.sm-skill-card__author { margin: 7px 0 0; color: #85858e; font-size: var(--t-xs); }
.sm-skill-card__author i { margin-left: 3px; color: #7657e8; font-size: var(--t-xxs); }
.sm-skill-card__description { min-height: 48px; margin: 16px 0 0; color: #66666f; font-size: var(--t-sm); line-height: 1.75; }
.sm-skill-card__tags { display: flex; flex-wrap: wrap; margin-top: 14px; gap: 6px; }
.sm-skill-card__tags span { padding: 6px 9px; border-radius: 5px; background: #f3f3f5; color: #5f5f68; font-size: var(--t-xs); }
.sm-skill-card__meta { display: flex; align-items: center; margin-top: 20px; padding: 14px 0; gap: 17px; border-top: 1px solid #ececef; border-bottom: 1px solid #ececef; color: #6f6f78; font-size: var(--t-xs); }
.sm-skill-card__meta i { margin-right: 3px; color: #8d78df; }
.sm-skill-card__meta span:last-child { margin-left: auto; font-family: "Cascadia Code", Consolas, monospace; }
.sm-skill-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 16px; }
.sm-skill-card__footer small { color: #9a9aa2; font-size: var(--t-xs); }
.sm-skill-install { height: 32px; padding: 0 12px; border: 1px solid rgba(118,87,232,.24); border-radius: 7px; color: #684ac9; background: #f8f6ff; font-size: var(--t-xs); font-weight: 650; }
.sm-skill-install:hover { background: #f0ecff; }
.sm-skill-install.is-installed { border-color: #e2e2e6; background: #f4f4f6; color: #777780; }
.sm-upload-skill-card { display: flex; min-height: 336px; align-items: center; justify-content: center; flex-direction: column; padding: 30px; gap: 9px; border: 1px dashed rgba(118,87,232,.3); border-radius: 15px; background: rgba(118,87,232,.025); text-align: center; }
.sm-upload-skill-card:hover { border-color: rgba(118,87,232,.56); background: rgba(118,87,232,.05); }
.sm-upload-skill-card > i { display: grid; width: 46px; height: 46px; margin-bottom: 6px; place-items: center; border-radius: 13px; background: #eeeafd; color: #7657e8; font-size: var(--t-md); }
.sm-upload-skill-card strong { color: #4e4e56; font-size: var(--t-sm); }
.sm-upload-skill-card span { max-width: 240px; color: #97979f; font-size: var(--t-xxs); line-height: 1.7; }
.sm-skill-dialog { width: min(680px,100%); }
.sm-zip-drop { display: flex; min-height: 145px; align-items: center; justify-content: center; flex-direction: column; padding: 22px; border: 1px dashed rgba(118,87,232,.32); border-radius: 12px; background: #faf9fe; color: #777780; cursor: pointer; text-align: center; transition: border-color .16s ease, background .16s ease; }
.sm-zip-drop:hover, .sm-zip-drop.is-dragging { border-color: #7657e8; background: #f5f2ff; }
.sm-zip-drop.has-file { border-style: solid; border-color: rgba(70,150,93,.3); background: #f7fbf8; }
.sm-zip-drop > i { color: #7657e8; font-size: 27px; }
.sm-zip-drop strong { margin-top: 13px; color: #414148; font-size: var(--t-xs); }
.sm-zip-drop span { margin-top: 6px; color: #96969e; font-size: var(--t-xxs); }
.sm-zip-drop small { margin-top: 12px; color: #6549c4; font-family: "Cascadia Code", Consolas, monospace; font-size: var(--t-xxs); }
.sm-skill-form-grid { margin-top: 20px; }

@media (max-width: 1180px) {
    .sm-skills-hero { grid-template-columns: minmax(0,1fr) 310px; }
    .sm-skill-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-skill-market__header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 800px) {
    .sm-skills-content { width: calc(100% - 30px); padding: 30px 0 44px; }
    .sm-skills-hero { grid-template-columns: 1fr; }
    .sm-skills-feature { min-height: 230px; border-top: 1px solid rgba(118,87,232,.13); border-left: 0; }
    .sm-skill-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-skill-metrics article:nth-child(2) { border-right: 0; }
    .sm-skill-metrics article:nth-child(-n+2) { border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-skill-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
    .sm-skill-toolbar .sm-model-search { width: 100%; }
}
@media (max-width: 580px) {
    .sm-skills-topbar .sm-primary-button { width: 40px; padding: 0; }
    .sm-skills-topbar .sm-primary-button span { display: none; }
    .sm-skills-hero > div:first-child { padding: 30px 22px; }
    .sm-skills-hero__actions { align-items: stretch; flex-direction: column; }
    .sm-skills-feature { padding: 30px 22px; }
    .sm-skill-metrics { grid-template-columns: 1fr; }
    .sm-skill-metrics article { border-right: 0; border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-skill-metrics article:last-child { border-bottom: 0; }
    .sm-skill-grid { grid-template-columns: 1fr; }
    .sm-skill-toolbar .sm-model-filters { width: 100%; overflow-x: auto; }
    .sm-skill-toolbar .sm-model-filters button { flex: 1; padding: 0 6px; }
}

/* Agent workspace */
.sm-agents-page { overflow: hidden; }
.sm-agents-main { background: #f7f7f9; }
.sm-agents-topbar { background: rgba(247,247,249,.94); backdrop-filter: blur(16px); }
.sm-agents-scroll { min-height: 0; flex: 1; overflow-y: auto; scrollbar-color: rgba(28,28,35,.13) transparent; }
.sm-agents-content { width: min(1240px,calc(100% - 64px)); margin: 0 auto; padding: 42px 0 64px; }
.sm-agents-hero { display: grid; min-height: 330px; grid-template-columns: minmax(0,1.2fr) minmax(350px,.8fr); overflow: hidden; border: 1px solid rgba(28,28,35,.1); border-radius: 18px; background: #fff; }
.sm-agents-hero__copy { display: flex; justify-content: center; flex-direction: column; padding: 42px 44px; }
.sm-agents-eyebrow { margin: 0 0 13px; color: #7657e8; font-size: var(--t-sm); font-weight: 760; letter-spacing: 1.6px; }
.sm-agents-hero h1 { margin: 0; color: #19191d; font-size: clamp(38px,4vw,56px); font-weight: 720; letter-spacing: -2.5px; line-height: 1.1; }
.sm-agents-hero__copy > p:nth-of-type(2) { max-width: 640px; margin: 17px 0 0; color: #707078; font-size: var(--t-base); line-height: 1.8; }
.sm-agents-hero__actions { display: flex; margin-top: 27px; gap: 9px; }
.sm-agents-hero__actions a { text-decoration: none; }
.sm-agent-orbit { position: relative; min-height: 330px; overflow: hidden; border-left: 1px solid rgba(118,87,232,.12); background: radial-gradient(circle at 50% 50%,rgba(118,87,232,.18),rgba(118,87,232,.045) 42%,transparent 68%),#f5f2ff; }
.sm-agent-orbit::before, .sm-agent-orbit::after { position: absolute; top: 50%; left: 50%; content: ""; border: 1px dashed rgba(118,87,232,.26); border-radius: 50%; transform: translate(-50%,-50%); animation: sm-agent-spin 24s linear infinite; }
.sm-agent-orbit::before { width: 230px; height: 230px; }
.sm-agent-orbit::after { width: 330px; height: 330px; animation-direction: reverse; animation-duration: 32s; }
.sm-agent-orbit__core { position: absolute; z-index: 2; top: 50%; left: 50%; display: grid; width: 78px; height: 78px; place-items: center; border: 9px solid rgba(255,255,255,.7); border-radius: 24px; background: linear-gradient(145deg,#8a6cf4,#6547d7); box-shadow: 0 22px 50px rgba(103,72,215,.3); color: #fff; font-size: 27px; transform: translate(-50%,-50%); }
.sm-agent-orbit__node { position: absolute; z-index: 3; display: flex; align-items: center; min-width: 82px; height: 36px; padding: 0 11px; gap: 7px; border: 1px solid rgba(118,87,232,.16); border-radius: 10px; background: rgba(255,255,255,.88); box-shadow: 0 9px 24px rgba(58,42,112,.11); color: #62518f; font-size: var(--t-xs); backdrop-filter: blur(10px); }
.sm-agent-orbit__node b { color: #3e345a; font-weight: 650; }
.sm-agent-orbit__node.is-model { top: 20%; left: 12%; animation: sm-agent-float 4.4s ease-in-out infinite; }
.sm-agent-orbit__node.is-skill { top: 29%; right: 9%; animation: sm-agent-float 5s ease-in-out -1.4s infinite; }
.sm-agent-orbit__node.is-kb { right: 20%; bottom: 16%; animation: sm-agent-float 4.8s ease-in-out -.7s infinite; }
@keyframes sm-agent-spin { to { transform: translate(-50%,-50%) rotate(1turn); } }
@keyframes sm-agent-float { 50% { transform: translateY(-7px); } }
.sm-agent-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 20px 0 38px; overflow: hidden; border: 1px solid rgba(28,28,35,.1); border-radius: 14px; background: #fff; }
.sm-agent-metrics article { display: flex; align-items: center; min-height: 82px; padding: 17px 20px; gap: 12px; border-right: 1px solid rgba(28,28,35,.09); }
.sm-agent-metrics article:last-child { border-right: 0; }
.sm-agent-metrics article > div { min-width: 0; }
.sm-agent-metrics strong { display: block; color: #242429; font-size: 20px; font-weight: 720; letter-spacing: -.6px; }
.sm-agent-metrics article > div > span { display: block; margin-top: 5px; color: #888890; font-size: var(--t-sm); }
.sm-agent-metric-icon { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 10px; font-size: var(--t-sm); }
.sm-agent-metric-icon.is-purple { background: #f0edfc; color: #7657e8; }
.sm-agent-metric-icon.is-green { background: #eaf7f1; color: #33815f; }
.sm-agent-metric-icon.is-blue { background: #eaf2ff; color: #3970c9; }
.sm-agent-metric-icon.is-orange { background: #fff1e8; color: #bc642c; }
.sm-agent-library__header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 24px; }
.sm-agent-library__header h2 { margin: 0; color: #222227; font-size: 20px; font-weight: 680; }
.sm-agent-library__header p { margin: 8px 0 0; color: #888890; font-size: var(--t-sm); }
.sm-agent-toolbar { display: flex; align-items: center; gap: 10px; }
.sm-agent-toolbar .sm-model-search { width: 250px; }
.sm-agent-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.sm-agent-card { display: flex; min-width: 0; min-height: 356px; flex-direction: column; padding: 22px; border: 1px solid rgba(28,28,35,.1); border-radius: 15px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.sm-agent-card:hover { border-color: rgba(118,87,232,.23); box-shadow: 0 14px 38px rgba(25,25,35,.07); transform: translateY(-2px); }
.sm-agent-card.is-featured { border-color: rgba(118,87,232,.23); box-shadow: inset 0 3px 0 #7657e8; }
.sm-agent-card__top { display: grid; grid-template-columns: 46px minmax(0,1fr) 28px; align-items: center; gap: 10px; }
.sm-agent-avatar { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; font-size: var(--t-md); }
.sm-agent-avatar.is-purple { background: #f0edfc; color: #7657e8; }
.sm-agent-avatar.is-blue { background: #eaf2ff; color: #3970c9; }
.sm-agent-avatar.is-green { background: #eaf7f1; color: #33815f; }
.sm-agent-avatar.is-orange { background: #fff1e8; color: #bc642c; }
.sm-agent-avatar.is-pink { background: #fcecf4; color: #b84f84; }
.sm-agent-avatar.is-slate { background: #eef0f4; color: #535b69; }
.sm-agent-status { display: flex; align-items: center; width: fit-content; padding: 5px 9px; gap: 5px; border-radius: 999px; background: #f1f1f3; color: #77777f; font-size: var(--t-xs); font-weight: 650; }
.sm-agent-status i { width: 5px; height: 5px; border-radius: 50%; background: #aaaab2; }
.sm-agent-status.is-active { background: #eaf7f1; color: #347b59; }
.sm-agent-status.is-active i { background: #3c9a6c; box-shadow: 0 0 0 3px rgba(60,154,108,.11); }
.sm-agent-more { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: #8b8b93; font-size: var(--t-xs); }
.sm-agent-more:hover { background: #f3f3f5; color: #4c4c54; }
.sm-agent-card h3 { margin: 18px 0 0; color: #25252a; font-size: var(--t-lg); font-weight: 690; }
.sm-agent-card > p { min-height: 48px; margin: 10px 0 0; color: #686870; font-size: var(--t-sm); line-height: 1.75; }
.sm-agent-stack { display: flex; flex-wrap: wrap; margin-top: 17px; gap: 6px; }
.sm-agent-stack span { padding: 6px 9px; border-radius: 6px; background: #f4f4f6; color: #5f5f68; font-size: var(--t-xs); }
.sm-agent-stack i { margin-right: 3px; color: #8573cc; }
.sm-agent-stack b { font-weight: 500; }
.sm-agent-card__meta { display: flex; justify-content: space-between; margin-top: 19px; padding: 14px 0; border-top: 1px solid #ececef; border-bottom: 1px solid #ececef; color: #85858d; font-size: var(--t-xs); }
.sm-agent-card__footer { display: flex; margin-top: auto; padding-top: 16px; gap: 8px; }
.sm-agent-card__footer button { display: flex; align-items: center; justify-content: center; height: 34px; gap: 6px; border-radius: 7px; font-size: var(--t-xs); font-weight: 650; }

/* 边框单独绘制，避免卡片背景和入场动画覆盖流光。 */
:is(.sm-model-card, .sm-skill-card, .sm-agent-card, .sm-kb-card) { position: relative; }
:is(.sm-model-card, .sm-skill-card, .sm-agent-card, .sm-kb-card)::before {
    position: absolute;
    inset: -1px;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(from var(--sm-card-marquee-angle, 0deg),
        #ded6fa 0% 16%, #7657e8 22%, #4f8dff 29%, #ded6fa 38% 100%);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    content: "";
    animation: sm-card-marquee 3.3s linear infinite;
}
.sm-kb-card::before { padding: 1px; }
@property --sm-card-marquee-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes sm-card-marquee { to { --sm-card-marquee-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) {
    :is(.sm-model-card, .sm-skill-card, .sm-agent-card, .sm-kb-card)::before { animation: none; }
}
body[data-theme="light"] .sm-model-card,
body[data-theme="light"] .sm-skill-card,
body[data-theme="light"] .sm-agent-card { box-shadow: 0 10px 28px rgba(55,45,115,.06); }
.sm-agent-chat, .sm-agent-publish { flex: 1; background: #7657e8; color: #fff; box-shadow: 0 7px 16px rgba(118,87,232,.15); }
.sm-agent-chat:hover, .sm-agent-publish:hover { background: #6849d8; }
.sm-agent-edit { width: 74px; border: 1px solid #e2e2e6; background: #fff; color: #66666f; }
.sm-agent-edit:hover { background: #f5f5f7; }
.sm-create-agent-card { display: flex; min-height: 356px; align-items: center; justify-content: center; flex-direction: column; gap: 9px; border: 1px dashed rgba(118,87,232,.3); border-radius: 15px; background: rgba(255,255,255,.52); color: #6f6f78; }
.sm-create-agent-card:hover { border-color: #7657e8; background: #faf9ff; color: #684ac9; }
.sm-create-agent-card > span { display: grid; width: 46px; height: 46px; margin-bottom: 5px; place-items: center; border-radius: 13px; background: #f0edfc; color: #7657e8; font-size: var(--t-md); }
.sm-create-agent-card strong { color: #3f3f47; font-size: var(--t-base); font-weight: 650; }
.sm-create-agent-card small { color: #94949c; font-size: var(--t-xxs); }
.sm-agent-dialog { width: min(760px,100%); }
.sm-agent-builder-head { display: flex; align-items: center; padding: 14px; gap: 12px; border: 1px solid #e9e6f5; border-radius: 11px; background: #faf9ff; }
.sm-agent-builder-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 11px; background: #7657e8; color: #fff; }
.sm-agent-builder-head strong { color: #36333f; font-size: var(--t-sm); }
.sm-agent-builder-head p { margin: 4px 0 0; color: #88838f; font-size: var(--t-xs); }
.sm-agent-form-grid { margin-top: 18px; }
.sm-agent-form-grid textarea { width: 100%; min-height: 88px; resize: vertical; padding: 11px 12px; border: 1px solid #dedee4; border-radius: 8px; color: #29292f; background: #fff; font: inherit; font-size: var(--t-xs); line-height: 1.6; }
.sm-agent-form-grid textarea:focus { border-color: rgba(118,87,232,.7); outline: 0; box-shadow: 0 0 0 3px rgba(118,87,232,.09); }
.sm-agent-resource-picker { margin-top: 18px; }
.sm-agent-resource-picker > div:first-child { display: flex; align-items: baseline; justify-content: space-between; }
.sm-agent-resource-picker > div:first-child strong { color: #3b3b42; font-size: var(--t-sm); }
.sm-agent-resource-picker > div:first-child span { color: #9a9aa2; font-size: var(--t-xs); }
.sm-agent-resource-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 9px; gap: 8px; }
.sm-agent-resource-options label { cursor: pointer; }
.sm-agent-resource-options input { position: absolute; opacity: 0; pointer-events: none; }
.sm-agent-resource-options label > span { display: flex; min-height: 70px; justify-content: center; flex-direction: column; padding: 10px; gap: 4px; border: 1px solid #e3e3e7; border-radius: 9px; color: #74747c; background: #fff; transition: .16s ease; }
.sm-agent-resource-options label > span i { margin-bottom: 3px; color: #8270c9; }
.sm-agent-resource-options label > span b { color: #48484f; font-size: var(--t-xs); font-weight: 620; }
.sm-agent-resource-options label > span small { color: #9999a1; font-size: var(--t-xs); }
.sm-agent-resource-options input:checked + span { border-color: rgba(118,87,232,.55); background: #f7f4ff; box-shadow: 0 0 0 2px rgba(118,87,232,.08); }

.sm-config-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(24,23,29,.28); opacity: 0; backdrop-filter: blur(2px); transition: opacity .2s ease; }
.sm-config-backdrop.is-open { opacity: 1; }
.sm-agent-config { position: fixed; z-index: 90; top: 0; right: 0; width: min(580px,100vw); height: 100dvh; border-left: 1px solid rgba(28,28,35,.1); background: #fff; box-shadow: -24px 0 70px rgba(25,25,35,.16); color: #29292f; transform: translateX(102%); transition: transform .22s cubic-bezier(.22,.8,.28,1); }
.sm-agent-config.is-open { transform: translateX(0); }
.sm-agent-config > form { display: flex; height: 100%; flex-direction: column; }
.sm-agent-config__header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 0 26px; border-bottom: 1px solid #e9e9ec; }
.sm-agent-config__header span { color: #8065de; font-size: var(--t-xxs); font-weight: 750; letter-spacing: 1.3px; }
.sm-agent-config__header h2 { margin: 5px 0 0; color: #27272d; font-size: 19px; font-weight: 690; }
.sm-agent-config__header button { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: #777780; background: #f4f4f6; }
.sm-agent-config__header button:hover { background: #ececef; color: #34343a; }
.sm-agent-config__summary { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; margin: 20px 26px 0; padding: 14px; gap: 12px; border: 1px solid #e8e5f2; border-radius: 12px; background: #faf9ff; }
.sm-agent-config__summary > div { min-width: 0; }
.sm-agent-config__summary strong { display: block; overflow: hidden; color: #34323a; font-size: var(--t-base); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sm-agent-config__summary > div > span { display: flex; align-items: center; margin-top: 5px; gap: 5px; color: #3f825e; font-size: var(--t-xxs); }
.sm-agent-config__summary > div > span i { width: 5px; height: 5px; border-radius: 50%; background: #429b6d; }
.sm-agent-config__summary > div > span.is-disabled { color: #8e8e96; }
.sm-agent-config__summary > div > span.is-disabled i { background: #a3a3aa; }
/* 配置面板的开关：独立组件，两种状态都由轨道自己持有，不依赖父元素透色 */
.sm-toggle { position: relative; display: inline-flex; width: 46px; height: 26px; flex: 0 0 auto; padding: 0; border-radius: 999px; cursor: pointer; }
.sm-toggle input { position: absolute; inset: 0; z-index: 1; opacity: 0; margin: 0; cursor: pointer; }
.sm-toggle > span { position: relative; display: block; width: 46px; height: 26px; border-radius: 999px; background: #d4d4da; transition: background .18s ease; }
.sm-toggle > span::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; content: ""; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.22); transition: transform .18s ease; }
.sm-toggle input:checked + span { background: #7657e8; }
.sm-toggle input:checked + span::after { transform: translateX(20px); }
.sm-toggle input:focus-visible + span { outline: 2px solid rgba(118,87,232,.7); outline-offset: 2px; }
.sm-toggle input:disabled { cursor: not-allowed; }
.sm-toggle input:disabled + span { opacity: .5; }
.sm-agent-config__tabs { display: grid; grid-template-columns: repeat(3,1fr); margin: 18px 26px 0; padding: 4px; gap: 4px; border-radius: 9px; background: #f3f3f5; }
.sm-agent-config__tabs button { display: flex; align-items: center; justify-content: center; height: 34px; gap: 7px; border-radius: 7px; color: #7a7a82; font-size: var(--t-xs); font-weight: 620; }
.sm-agent-config__tabs button.is-active { background: #fff; box-shadow: 0 2px 8px rgba(26,26,35,.08); color: #6347c2; }
.sm-agent-config__body { min-height: 0; flex: 1; overflow-y: auto; padding: 24px 26px 32px; scrollbar-color: rgba(35,35,45,.16) transparent; }
.sm-agent-config__section { animation: sm-config-enter .16s ease; }
@keyframes sm-config-enter { from { opacity: 0; transform: translateY(4px); } }
.sm-agent-config__heading { margin-bottom: 18px; }
.sm-agent-config__heading strong { display: block; color: #33333a; font-size: var(--t-base); font-weight: 660; }
.sm-agent-config__heading span { display: block; margin-top: 5px; color: #94949c; font-size: var(--t-xs); }
.sm-config-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 12px; }
.sm-config-fields label { position: relative; display: flex; min-width: 0; flex-direction: column; gap: 7px; color: #57575f; font-size: var(--t-xxs); font-weight: 600; }
.sm-config-fields label.is-wide { grid-column: 1/-1; }
.sm-config-fields input, .sm-config-fields select, .sm-config-fields textarea { width: 100%; border: 1px solid #dddde2; border-radius: 8px; outline: 0; color: #2d2d33; background: #fff; font: inherit; font-size: var(--t-xs); font-weight: 450; transition: border-color .15s ease,box-shadow .15s ease; }
.sm-config-fields input, .sm-config-fields select { height: 39px; padding: 0 11px; }
.sm-config-fields textarea { resize: vertical; padding: 11px; line-height: 1.65; }
.sm-config-fields input:focus, .sm-config-fields select:focus, .sm-config-fields textarea:focus { border-color: rgba(118,87,232,.7); box-shadow: 0 0 0 3px rgba(118,87,232,.08); }
.sm-config-fields label > small { position: absolute; right: 8px; bottom: 7px; color: #a1a1a8; font-size: var(--t-xxs); font-weight: 450; }
.sm-config-resource-group + .sm-config-resource-group { margin-top: 25px; padding-top: 22px; border-top: 1px solid #ececef; }
.sm-config-resource-group > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.sm-config-resource-group > div strong { color: #45454c; font-size: var(--t-xs); }
.sm-config-resource-group > div a { color: #7358d2; font-size: var(--t-xxs); text-decoration: none; }
.sm-config-resource-group > label { display: block; margin-top: 8px; cursor: pointer; }
.sm-config-resource-group > label > input { position: absolute; opacity: 0; pointer-events: none; }
.sm-config-resource-group > label > span { position: relative; display: grid; min-height: 56px; grid-template-columns: 36px minmax(0,1fr); align-items: center; padding: 9px 42px 9px 10px; column-gap: 10px; border: 1px solid #e4e4e8; border-radius: 9px; background: #fff; transition: .15s ease; }
.sm-config-resource-group > label > span > i { display: grid; width: 36px; height: 36px; grid-row: 1/3; place-items: center; border-radius: 9px; background: #f1eefc; color: #7657e8; }
.sm-config-resource-group > label > span b { align-self: end; color: #414148; font-size: var(--t-xs); font-weight: 630; }
.sm-config-resource-group > label > span small { align-self: start; margin-top: 3px; color: #9898a0; font-size: var(--t-xxs); }
.sm-config-resource-group > label > input:checked + span { border-color: rgba(118,87,232,.48); background: #faf9ff; box-shadow: 0 0 0 2px rgba(118,87,232,.07); }
.sm-config-resource-group > label > input:checked + span::after { position: absolute; top: 50%; right: 12px; display: grid; width: 18px; height: 18px; place-items: center; content: "✓"; border-radius: 50%; background: #7657e8; color: #fff; font-size: var(--t-xxs); transform: translateY(-50%); }
.sm-config-range { padding: 16px; border: 1px solid #e5e5e9; border-radius: 10px; background: #fafafa; }
.sm-config-range > div { display: flex; align-items: center; justify-content: space-between; }
.sm-config-range label { color: #47474e; font-size: var(--t-xs); font-weight: 620; }
.sm-config-range output { min-width: 34px; padding: 4px 7px; border-radius: 6px; background: #ede9fc; color: #684ac7; font-size: var(--t-xxs); text-align: center; }
.sm-config-range input { width: 100%; margin: 15px 0 5px; accent-color: #7657e8; }
.sm-config-range p { margin: 4px 0 0; color: #9898a0; font-size: var(--t-xxs); }
.sm-config-range + .sm-config-fields { margin-top: 17px; }
.sm-config-toggles { margin-top: 19px; border-top: 1px solid #ececef; }
.sm-config-toggles > label { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 14px; border-bottom: 1px solid #ececef; }
.sm-config-toggles > label > span:first-child { display: grid; min-width: 0; grid-template-columns: 27px minmax(0,1fr); align-items: center; column-gap: 9px; }
.sm-config-toggles > label > span:first-child > i { grid-row: 1/3; color: #8069cf; font-size: var(--t-sm); text-align: center; }
.sm-config-toggles b { align-self: end; color: #45454c; font-size: var(--t-xs); font-weight: 620; }
.sm-config-toggles small { align-self: start; margin-top: 3px; overflow: hidden; color: #9999a1; font-size: var(--t-xxs); text-overflow: ellipsis; white-space: nowrap; }
.sm-agent-test { display: grid; width: 100%; min-height: 62px; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; margin-top: 20px; padding: 10px 12px; gap: 10px; border: 1px solid #e5e1f3; border-radius: 10px; background: #faf9ff; text-align: left; }
.sm-agent-test > i:first-child { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #ebe6fb; color: #7657e8; }
.sm-agent-test span { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.sm-agent-test b { color: #49454f; font-size: var(--t-xs); }
.sm-agent-test small { color: #9994a1; font-size: var(--t-xxs); }
.sm-agent-test > i:last-child { color: #aaa5b5; font-size: var(--t-xxs); }
.sm-agent-config__footer { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 26px; gap: 14px; border-top: 1px solid #e9e9ec; background: #fff; }
.sm-agent-config__footer > div { display: flex; gap: 8px; }
.sm-agent-delete { display: flex; align-items: center; height: 38px; padding: 0 10px; gap: 7px; border-radius: 8px; color: #b64e55; font-size: var(--t-xs); }
.sm-agent-delete:hover, .sm-agent-delete[data-confirmed] { background: #fff0f0; }

@media (max-width: 1180px) {
    .sm-agents-hero { grid-template-columns: minmax(0,1fr) 340px; }
    .sm-agent-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-agent-library__header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 800px) {
    .sm-agents-content { width: calc(100% - 30px); padding: 30px 0 44px; }
    .sm-agents-hero { grid-template-columns: 1fr; }
    .sm-agent-orbit { min-height: 285px; border-top: 1px solid rgba(118,87,232,.12); border-left: 0; }
    .sm-agent-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .sm-agent-metrics article:nth-child(2) { border-right: 0; }
    .sm-agent-metrics article:nth-child(-n+2) { border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-agent-toolbar { width: 100%; align-items: stretch; flex-direction: column; }
    .sm-agent-toolbar .sm-model-search { width: 100%; }
    .sm-agent-resource-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 580px) {
    .sm-agents-topbar .sm-primary-button { width: 40px; padding: 0; }
    .sm-agents-topbar .sm-primary-button span { display: none; }
    .sm-agents-hero__copy { padding: 30px 22px; }
    .sm-agents-hero h1 { font-size: 37px; letter-spacing: -1.8px; }
    .sm-agents-hero__actions { align-items: stretch; flex-direction: column; }
    .sm-agent-orbit { min-height: 250px; }
    .sm-agent-orbit::before { width: 190px; height: 190px; }
    .sm-agent-orbit::after { width: 280px; height: 280px; }
    .sm-agent-orbit__node.is-model { left: 5%; }
    .sm-agent-orbit__node.is-skill { right: 4%; }
    .sm-agent-metrics { grid-template-columns: 1fr; }
    .sm-agent-metrics article { border-right: 0; border-bottom: 1px solid rgba(28,28,35,.09); }
    .sm-agent-metrics article:last-child { border-bottom: 0; }
    .sm-agent-grid { grid-template-columns: 1fr; }
    .sm-agent-toolbar .sm-model-filters { width: 100%; }
    .sm-agent-toolbar .sm-model-filters button { flex: 1; }
    .sm-agent-resource-picker > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
    .sm-agent-config__header { min-height: 66px; padding: 0 18px; }
    .sm-agent-config__summary { margin: 14px 18px 0; }
    .sm-agent-config__tabs { margin: 14px 18px 0; }
    .sm-agent-config__body { padding: 20px 18px 26px; }
    .sm-config-fields { grid-template-columns: 1fr; }
    .sm-config-fields label.is-wide { grid-column: auto; }
    .sm-agent-config__footer { min-height: 70px; padding: 0 18px; }
    .sm-agent-config__footer .sm-secondary-button { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sm-agent-orbit::before, .sm-agent-orbit::after, .sm-agent-orbit__node { animation: none; }
    .sm-type-cursor { display: none; animation: none; }
}

/* ============================================================
   ShenMaAI 动效系统
   —— 顶部进度条 / 滚动显现 / Hero 极光 / 标题流光 / 卡片光晕
   ============================================================ */

/* ---------- 顶部滚动进度条 ---------- */
.sm-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #7657e8 0%, #4f8dff 52%, #22d3ee 100%);
    transform: scaleX(0);
    transform-origin: left center;
    box-shadow: 0 0 14px rgba(118, 87, 232, .55);
    pointer-events: none;
    will-change: transform;
}

/* ---------- 滚动显现（同组元素错峰进场） ---------- */
.sm-reveal {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition:
        opacity .62s cubic-bezier(.22, .61, .36, 1) var(--sm-delay, 0ms),
        transform .62s cubic-bezier(.22, .61, .36, 1) var(--sm-delay, 0ms);
}

.sm-reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ---------- Hero 极光背景 ---------- */
.sm-models-hero,
.sm-kb-hero,
.sm-skills-hero,
.sm-agents-hero {
    position: relative;
    isolation: isolate;
    /* 极光光晕是 left:-14% 的负偏移，不裁剪会顶出横向滚动条 */
    overflow: hidden;
}

.sm-models-hero::before,
.sm-kb-hero::before,
.sm-skills-hero::before,
.sm-agents-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: -14%;
    top: -75%;
    width: 66%;
    height: 250%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(118, 87, 232, .22), rgba(118, 87, 232, 0) 62%);
    filter: blur(22px);
    animation: sm-aurora 16s ease-in-out infinite alternate;
    pointer-events: none;
}

.sm-models-hero::after,
.sm-kb-hero::after,
.sm-skills-hero::after,
.sm-agents-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -12%;
    top: -65%;
    width: 50%;
    height: 230%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(79, 141, 255, .18), rgba(79, 141, 255, 0) 62%);
    filter: blur(24px);
    animation: sm-aurora 21s ease-in-out infinite alternate-reverse;
    pointer-events: none;
}

@keyframes sm-aurora {
    from { transform: translate3d(-3%, -2%, 0) scale(1); }
    to { transform: translate3d(7%, 5%, 0) scale(1.14); }
}

/* ---------- Hero 标题流光 ---------- */
.sm-models-hero h1,
.sm-kb-hero h1,
.sm-skills-hero h1,
.sm-agents-hero h1 {
    background-image: linear-gradient(100deg, #1b1b21 14%, #6d4fd6 32%, #2f7fe0 44%, #1b1b21 62%);
    background-size: 280% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: sm-shimmer 7s linear infinite;
}

@keyframes sm-shimmer {
    from { background-position: 0 0; }
    to { background-position: 280% 0; }
}

/* ---------- 卡片：鼠标光晕跟随 + 抬升 ---------- */
.sm-model-card,
.sm-kb-card,
.sm-skill-card,
.sm-agent-card {
    background-image: radial-gradient(360px circle at var(--sm-x, 50%) var(--sm-y, 50%), rgba(118, 87, 232, .12), transparent 62%);
    background-repeat: no-repeat;
    transition:
        transform .32s cubic-bezier(.22, .61, .36, 1),
        box-shadow .32s cubic-bezier(.22, .61, .36, 1),
        border-color .32s ease;
}

.sm-model-card:hover,
.sm-kb-card:hover,
.sm-skill-card:hover,
.sm-agent-card:hover {
    transform: translateY(-5px);
    border-color: rgba(118, 87, 232, .28);
    box-shadow: 0 20px 44px rgba(28, 28, 45, .10);
}

.sm-model-card.is-featured:hover,
.sm-skill-card.is-featured:hover,
.sm-agent-card.is-featured:hover {
    box-shadow: inset 0 3px 0 #7657e8, 0 20px 44px rgba(28, 28, 45, .10);
}

/* ---------- 智能体页轨道节点浮动 ---------- */
.sm-agent-orbit__node {
    animation: sm-float 7s ease-in-out infinite;
}

.sm-agent-orbit__node.is-model { animation-delay: 0s; }
.sm-agent-orbit__node.is-skill { animation-delay: .9s; }
.sm-agent-orbit__node.is-kb { animation-delay: 1.8s; }

@keyframes sm-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

/* ---------- 知识库索引进度条 ---------- */
.sm-kb-progress > i span {
    width: 0;
    transition: width 1.1s cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 减少动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
    .sm-progress { display: none; }
    .sm-reveal { opacity: 1; transform: none; transition: none; }
    .sm-models-hero::before, .sm-kb-hero::before, .sm-skills-hero::before, .sm-agents-hero::before,
    .sm-models-hero::after, .sm-kb-hero::after, .sm-skills-hero::after, .sm-agents-hero::after,
    .sm-models-hero h1, .sm-kb-hero h1, .sm-skills-hero h1, .sm-agents-hero h1,
    .sm-agent-orbit__node {
        animation: none;
    }
    .sm-models-hero h1, .sm-kb-hero h1, .sm-skills-hero h1, .sm-agents-hero h1 {
        background-image: none;
        color: #19191d;
        -webkit-text-fill-color: currentColor;
    }
}

/* ============================================================
   聊天页 · 逐字打字 + 极光
   ============================================================ */

/* 仅供读屏器读取的完整文案 */
.sm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* 打字光标 */
.sm-type-caret {
    display: inline-block;
    width: 2px;
    height: .92em;
    margin-left: 3px;
    vertical-align: -.08em;
    border-radius: 1px;
    background: currentColor;
    animation: sm-type-blink 1s steps(1) infinite;
}

@keyframes sm-type-blink {
    50% { opacity: 0; }
}

/* 聊天页标题区极光 */
.sm-empty__heading {
    position: relative;
    isolation: isolate;
}

.sm-empty__heading::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: -22%;
    top: -70%;
    width: 100%;
    height: 260%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(118, 87, 232, .20), rgba(118, 87, 232, 0) 64%);
    filter: blur(26px);
    animation: sm-aurora 17s ease-in-out infinite alternate;
    pointer-events: none;
}

.sm-empty__heading::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -18%;
    top: -55%;
    width: 72%;
    height: 230%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(79, 141, 255, .16), rgba(79, 141, 255, 0) 64%);
    filter: blur(28px);
    animation: sm-aurora 22s ease-in-out infinite alternate-reverse;
    pointer-events: none;
}

/* 推荐任务：悬停时箭头前推一点 */
.sm-suggestions button {
    transition: color .18s ease, background .18s ease, padding .18s ease, opacity .5s ease;
}

.sm-suggestions button > i:first-child {
    transition: transform .22s cubic-bezier(.22, .61, .36, 1);
}

.sm-suggestions button:hover > i:first-child {
    transform: scale(1.14);
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
    .sm-empty__heading::before, .sm-empty__heading::after { animation: none; }
    .sm-suggestions button, .sm-suggestions button > i:first-child { transition: none; }
    .sm-toast { animation: none; }
}

@media (max-width: 580px) {
    .sm-toast { top: 72px; right: 12px; left: 12px; min-width: 0; max-width: none; min-height: 60px; }
    .sm-models-hero, .sm-kb-hero { min-height: 0; padding: 30px 22px; }
    .sm-model-health, .sm-kb-sync { width: 100%; min-width: 0; }
}

/* ============================================================
   标签切换 · 卡片进场
   ============================================================ */

.sm-card-enter {
    animation: sm-card-in .42s cubic-bezier(.22, .61, .36, 1) backwards;
}

@keyframes sm-card-in {
    from {
        opacity: 0;
        transform: translate3d(0, 14px, 0) scale(.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* 减少动态效果：不位移，直接显示 */
@media (prefers-reduced-motion: reduce) {
    .sm-filter-indicator { transition: none; }
    .sm-card-enter { animation: none; }
}

/* ============================================================
   矮窗口适配：侧边栏纵向收缩
   侧边栏固定部分是「品牌 72 + 新建对话 50 + 导航 305 + 账号 64」≈ 491px，
   窗口低于 ~820px 时留给「最近对话」的空间就不足了。
   这里在矮屏下按比例压缩各区块，把空间还给历史列表 ——
   否则用户会看到「对话记录只显示几条」，误以为数据丢了。
   ============================================================ */
@media (max-height: 820px) {
    .sm-brand {
        height: 56px;
        margin-bottom: 8px;
    }

    .sm-new-chat {
        height: 42px;
        font-size: var(--t-sm);
    }

    .sm-nav {
        margin-top: 10px;
        gap: 2px;
    }

    .sm-nav__item {
        height: 36px;
        gap: 11px;
    }

    .sm-history {
        margin-top: 10px;
        min-height: 140px;
    }

    .sm-history button {
        height: 34px;
    }

    .sm-account {
        padding-top: 8px;
    }

    .sm-account__main {
        padding: 5px;
    }
}

/* 更矮（笔记本分屏、小窗）时进一步收紧，保证至少能看到 4 条 */
@media (max-height: 680px) {
    .sm-nav__item {
        height: 32px;
    }

    .sm-history {
        min-height: 124px;
    }

    .sm-history button {
        height: 31px;
    }

    .sm-brand {
        height: 50px;
    }
}

/* 减少动态效果：历史项直接显示 */
@media (prefers-reduced-motion: reduce) {
    .sm-history button { animation: none; }
}

/*
 * 覆盖 Cherry 的表格边框变量。
 * Cherry 用 --md-table-border 控制边框色，直接在容器上改掉它，
 * 比逐个元素加 !important 更彻底 —— 也避免以后 Cherry 升级改了选择器就失效。
 */
.sm-message__md {
    --md-table-border: transparent;
    --md-table-head-background: transparent;
    --md-table-background: transparent;
}
