/* ============================================================================
   对话页样式 — 消费 design-system.css 令牌
   ============================================================================ */

body {
    background: var(--ds-bg);
}

/* ── 工作区：主区域占满剩余宽度 ──
   聊天页已不加载 chat-mcp.css，这里补齐工作区布局。 */

.chat-workspace {
    flex: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
    height: 100vh;
    position: relative;
}

.chat-workspace .main-area {
    flex: 1;
    min-width: 0;
    height: 100%;
}

/* ── 左侧边栏 ── */

.sidebar {
    background: var(--ds-bg-subtle);
    border-right: 1px solid var(--ds-border-subtle);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 12px;
}

.sidebar-brand__logo {
    width: 26px;
    height: 26px;
    padding: 3px;
    flex-shrink: 0;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-gradient-accent);
}

.sidebar-brand__name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ds-text);
    white-space: nowrap;
}

.sidebar-brand__home {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--ds-radius);
    color: var(--ds-text-muted);
    transition: background var(--ds-duration) var(--ds-ease),
        color var(--ds-duration) var(--ds-ease);
    -webkit-tap-highlight-color: transparent;
}

.sidebar-brand__home:hover {
    background: var(--ds-surface-hover);
    color: var(--ds-text);
}

.sidebar-header {
    padding: 4px 12px 12px;
    border-bottom: none;
}

.new-chat-btn {
    padding: 10px 12px;
    background: var(--ds-gradient-accent);
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md);
    color: var(--ds-accent-contrast);
    font-size: 13.5px;
    font-weight: 600;
    transition: filter var(--ds-duration) var(--ds-ease),
        box-shadow var(--ds-duration) var(--ds-ease);
}

.new-chat-btn:hover {
    filter: brightness(1.06);
    box-shadow: var(--ds-shadow-accent);
}

.new-chat-btn-icon img {
    filter: brightness(0);
}

.conversations-list {
    padding: 4px 10px 10px;
}

.conversation-item {
    padding: 10px 12px;
    margin-bottom: 2px;
    border-left: none;
    border-radius: var(--ds-radius-md);
    color: var(--ds-text-secondary);
    font-size: 13.5px;
    font-weight: 500;
}

.conversation-item:hover {
    background: var(--ds-surface-hover);
    color: var(--ds-text);
}

.conversation-item.active {
    background: var(--ds-accent-soft);
    border-left-color: transparent;
    color: var(--ds-text);
    box-shadow: inset 0 0 0 1px var(--ds-accent-border);
}

.conversation-menu-btn {
    color: var(--ds-text-faint);
}

.conversation-menu-btn:hover {
    background: var(--ds-surface-hover);
    color: var(--ds-text);
}

.conversation-dropdown {
    border-color: var(--ds-border);
    border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-lg);
}

.sidebar-footer {
    border-top: 1px solid var(--ds-border-subtle);
}

.user-info {
    border-radius: var(--ds-radius-md);
}

.user-info:hover {
    background: var(--ds-surface-hover);
}

.user-avatar {
    background: var(--ds-gradient-accent);
    color: var(--ds-accent-contrast);
}

/* ── 顶部栏 ── */

.chat-header {
    background: rgba(5, 5, 6, 0.78);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--ds-border-subtle);
}

.chat-brand-logo {
    width: 24px;
    height: 24px;
    padding: 3px;
    flex-shrink: 0;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-gradient-accent);
}

.chat-title-wrap {
    gap: 10px;
}

.chat-title {
    font-size: 15px;
    letter-spacing: -0.01em;
}

.ai-provider-badge {
    padding: 4px 10px;
    background: var(--ds-accent-soft);
    border: 1px solid var(--ds-accent-border);
    border-radius: var(--ds-radius-pill);
    color: var(--ds-accent);
    font-size: 12px;
}

.header-btn {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    color: var(--ds-text-secondary);
    font-size: 13px;
}

.header-btn:hover {
    background: var(--ds-surface-hover);
    border-color: var(--ds-border-strong);
    color: var(--ds-text);
}

.sidebar-toggle-btn {
    border-color: var(--ds-border);
}

/* ── 消息区（两侧头像 + 昵称/时间） ── */

.msg-aside {
    display: flex;
}

.msg-header {
    margin-bottom: 8px;
    min-height: 0;
}

.msg-header-text {
    min-height: var(--msg-avatar-size);
    gap: 2px;
    justify-content: center;
}

.msg-sender {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--c-text);
}

.msg-time {
    font-size: 11px;
    line-height: 1.35;
    color: var(--ds-text-faint);
    letter-spacing: 0.01em;
}

.msg-avatar {
    border-radius: 12px;
}

.msg-row--assistant .msg-avatar {
    border: 1px solid var(--ds-border-subtle);
}

.msg-bubble {
    border-radius: var(--ds-radius-lg);
    font-size: 15px;
    line-height: 1.7;
    padding: 12px 16px;
}

.msg-row--assistant .msg-bubble,
.msg-row--assistant .msg-bubble--assistant {
    background: transparent;
    border: none;
    padding: 0;
}

.msg-row--user .msg-bubble,
.msg-row--user .msg-bubble--user {
    background: var(--c-user-bubble);
    border: 1px solid var(--c-user-bubble-border);
    max-width: min(82%, 640px);
}

.msg-row--assistant .message-content {
    font-size: 15.5px;
    line-height: 1.75;
}

/* ── 输入区 ── */

.composer {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: 20px;
    transition: border-color var(--ds-duration) var(--ds-ease),
        box-shadow var(--ds-duration) var(--ds-ease);
}

.composer:focus-within {
    border-color: var(--ds-accent-border);
    box-shadow: 0 0 0 4px var(--ds-accent-ring);
}

.composer-toolbar {
    border-top: 1px solid var(--ds-border-subtle);
}

.toolbar-icon-btn:hover,
.model-select-btn:hover {
    background: var(--ds-surface-hover);
    border-color: var(--ds-border);
    color: var(--ds-text);
}

.shortcut-hint {
    color: var(--ds-text-faint);
}

.send-btn-circle {
    background: var(--ds-gradient-accent);
    color: var(--ds-accent-contrast);
    box-shadow: var(--ds-shadow-accent);
}

.send-btn-circle:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow: var(--ds-shadow-accent-hover);
}

.send-btn-circle:disabled {
    background: var(--ds-raised);
    color: var(--ds-text-faint);
    box-shadow: none;
}

.send-btn-circle--stop,
.send-btn-circle--stop:hover:not(:disabled) {
    background: var(--ds-danger);
    color: #fff;
    box-shadow: none;
}

/* ── 欢迎屏 ── */

.welcome-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ds-radius-lg);
    background: var(--ds-gradient-accent);
    border: 1px solid transparent;
    box-shadow: var(--ds-shadow-accent);
    margin-bottom: 22px;
}

.welcome-icon img {
    width: 30px;
    height: 30px;
    filter: brightness(0);
    opacity: 0.9;
}

.welcome-title {
    letter-spacing: -0.02em;
    color: var(--ds-text);
}

.welcome-subtitle {
    color: var(--ds-text-muted);
}

.example-prompts {
    max-width: 820px;
    gap: 14px;
}

.example-prompt {
    padding: 18px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius-lg);
    transition: border-color var(--ds-duration) var(--ds-ease),
        background-color var(--ds-duration) var(--ds-ease),
        transform var(--ds-duration) var(--ds-ease),
        box-shadow var(--ds-duration) var(--ds-ease);
}

.example-prompt:hover {
    background: var(--ds-surface-hover);
    border-color: var(--ds-accent-border);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -18px rgba(45, 212, 191, 0.5);
}

.example-prompt-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--ds-text);
}

.example-prompt-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--ds-accent);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.example-prompt-text {
    line-height: 1.6;
    color: var(--ds-text-muted);
}

/* ── 可拉伸侧栏 ── */

.sidebar-resizer {
    display: none;
    position: absolute;
    top: 0;
    right: -3px;
    width: 7px;
    height: 100%;
    z-index: 6;
    cursor: col-resize;
    touch-action: none;
}

@media (min-width: 769px) {
    .sidebar {
        position: relative;
        width: var(--sidebar-width, 260px);
        min-width: 232px;
        max-width: 460px;
        /* 桌面端宽度由拖拽控制，取消宽度过渡避免恢复时闪动 */
        transition: none;
    }

    .sidebar-resizer {
        display: block;
    }
}

.sidebar-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
    background: transparent;
    transition: background var(--ds-duration) var(--ds-ease);
}

.sidebar-resizer:hover::after,
.sidebar-resizer:focus-visible::after,
body.is-resizing .sidebar-resizer::after {
    background: var(--ds-accent);
    opacity: 0.72;
}

.sidebar-resizer:focus-visible {
    outline: none;
    box-shadow: none;
}

body.is-resizing,
body.is-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

body.is-resizing .sidebar {
    transition: none;
}

/* ── 对话搜索 ── */

.conversation-search {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.conversation-search__icon {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--ds-text-faint);
    pointer-events: none;
}

.conversation-search input {
    width: 100%;
    height: 34px;
    padding: 0 30px 0 32px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border-subtle);
    border-radius: var(--ds-radius);
    color: var(--ds-text);
    font-family: inherit;
    font-size: 13px;
    -webkit-appearance: none;
    appearance: none;
    transition: background var(--ds-duration) var(--ds-ease),
        border-color var(--ds-duration) var(--ds-ease),
        box-shadow var(--ds-duration) var(--ds-ease);
}

.conversation-search input::placeholder {
    color: var(--ds-text-faint);
}

.conversation-search input:hover {
    border-color: var(--ds-border);
}

.conversation-search input:focus {
    outline: none;
    background: var(--ds-surface-hover);
    border-color: var(--ds-accent-border);
    box-shadow: 0 0 0 3px var(--ds-accent-ring);
}

.conversation-search input::-webkit-search-cancel-button {
    display: none;
}

.conversation-search__clear {
    position: absolute;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: var(--ds-radius-sm);
    background: transparent;
    color: var(--ds-text-muted);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--ds-duration) var(--ds-ease),
        color var(--ds-duration) var(--ds-ease);
}

.conversation-search__clear:hover {
    background: var(--ds-raised);
    color: var(--ds-text);
}

@media (max-width: 768px) {
    /* 避免 iOS 聚焦搜索框时自动放大页面 */
    .conversation-search input {
        font-size: 16px;
    }
}

/* ── 对话列表：日期分组与滚动条 ── */

.conversations-list {
    scrollbar-width: thin;
    scrollbar-color: #2a2f31 transparent;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-thumb {
    background: #22282a;
    border-radius: var(--ds-radius-pill);
}

.conversations-list::-webkit-scrollbar-thumb:hover {
    background: #333b3d;
}

.conversation-group + .conversation-group {
    margin-top: 10px;
}

.conversation-group__label {
    padding: 6px 12px 4px;
    color: var(--ds-text-faint);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.conversation-item__body {
    flex: 1;
    min-width: 0;
}

.conversation-time {
    margin-top: 2px;
    color: var(--ds-text-faint);
    font-size: 11px;
    letter-spacing: 0.01em;
}

/* ── 侧栏空状态 ── */

.empty-state--conversations,
.empty-state--search {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 32px 16px;
    text-align: center;
}

.empty-state--conversations svg,
.empty-state--search svg {
    width: 28px;
    height: 28px;
    color: var(--ds-text-faint);
    opacity: 0.9;
}

.empty-state--conversations p,
.empty-state--search p {
    margin: 0;
    color: var(--ds-text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.empty-state--conversations span,
.empty-state--search span {
    color: var(--ds-text-faint);
    font-size: 12px;
}

/* ── 细节：标签、选择器、按钮态 ── */

.agent-badge,
.agent-picker-tag,
.conversation-agent-tag {
    background: var(--ds-accent-soft);
    border: 1px solid var(--ds-accent-border);
    color: var(--ds-accent);
}

.thinking-option.active {
    background: var(--ds-surface-hover);
    color: var(--ds-text);
}

.message-content pre .copy-btn.copied,
.copy-message-btn.copied {
    background: var(--ds-accent);
    border-color: var(--ds-accent);
    color: var(--ds-accent-contrast);
}

.audio-play-btn:hover,
.copy-message-btn:hover,
.regenerate-btn:hover {
    border-color: var(--ds-border-strong);
    background: var(--ds-surface-hover);
    opacity: 1;
}

.audio-play-btn.playing {
    border-color: var(--ds-accent-border);
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
}

.model-picker,
.thinking-picker {
    background: var(--ds-raised);
    border-color: var(--ds-border);
    box-shadow: var(--ds-shadow-lg);
}

.model-picker-item:hover,
.model-picker-item.active,
.thinking-option:hover {
    background: var(--ds-surface-hover);
}

.model-picker.model-picker--sheet .model-picker-item.active {
    background: var(--ds-surface-hover);
}

.model-picker-check {
    color: var(--ds-accent);
}

/* MCP 开关 */
.mcp-panel .mcp-toggle-input:checked+.mcp-toggle-track {
    background: var(--ds-accent);
}

.mcp-panel .mcp-toggle-input:checked+.mcp-toggle-track::after {
    background: var(--ds-accent-contrast);
}

#asrRecognitionDisplay {
    background: var(--ds-surface);
    border-top: 1px solid var(--ds-border);
    color: var(--ds-text);
}

#asrRecognitionDisplay.is-final {
    background: var(--ds-surface-hover);
    border-top-color: var(--ds-accent-border);
    color: var(--ds-text);
}

/* 滚动条对齐首页 */
.chat-container::-webkit-scrollbar-thumb {
    background: #22282a;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #333b3d;
}

/* 焦点可见性 */
.new-chat-btn:focus-visible,
.sidebar-brand__home:focus-visible,
.header-btn:focus-visible,
.sidebar-toggle-btn:focus-visible,
.send-btn-circle:focus-visible,
.example-prompt:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

/* 中等宽度：MCP 展开时输入栏空间有限，隐藏次要信息并允许选择器收缩 */
@media (max-width: 1200px) {
    .shortcut-hint,
    .ai-provider-badge {
        display: none;
    }

    .toolbar-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .model-picker-wrap,
    .agent-picker-wrap {
        min-width: 0;
        flex-shrink: 1;
    }

    .model-select-btn,
    .agent-select-btn {
        max-width: 150px;
        min-width: 0;
        flex-shrink: 1;
    }

    .model-select-label {
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 窄桌面（侧栏与 MCP 同时展开）：工具栏换行，发送按钮单独一行靠右，避免重叠 */
@media (min-width: 769px) and (max-width: 1000px) {
    .composer-toolbar {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .toolbar-left {
        flex: 1 1 100%;
    }

    .toolbar-right {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
}

/* ── 桌面端：内容与输入框同宽居中 ── */

@media (min-width: 769px) {
    .main-area {
        --msg-h-padding: 20px;
        --msg-avatar-size: 36px;
        --msg-aside-width: 36px;
        --msg-gap: 10px;
        --msg-side-gutter: 0px;
        --msg-header-name-size: 13px;
        --msg-header-time-size: 11px;
        --msg-header-gap: 2px;
        --msg-header-line-height: 1.35;
        --msg-lane-inset: 0px;
        --msg-lane-width: 100%;
    }

    .chat-container {
        padding: 28px 20px 4px;
        gap: 26px;
    }

    .msg-row {
        width: 100%;
        max-width: 820px;
        margin-left: auto;
        margin-right: auto;
        gap: var(--msg-gap);
    }

    .msg-block {
        max-width: 100%;
    }

    .input-area {
        padding: 10px 20px 18px;
    }

    .input-container {
        width: 100%;
        max-width: 820px;
        margin-left: auto;
        margin-right: auto;
    }

    .input-area .chat-legal-footer {
        width: 100%;
        max-width: 820px;
        margin: 8px auto 0;
    }
}

/* ── Agent 设置抽屉 ── */

.agent-picker-default {
    padding: 1px 6px;
    border: 1px solid var(--ds-accent-border);
    border-radius: 999px;
    background: var(--ds-accent-soft);
    color: var(--ds-accent);
    font-size: 10.5px;
}

.agent-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.agent-drawer-backdrop[hidden],
.agent-drawer[hidden] {
    display: none;
}

.agent-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    display: flex;
    flex-direction: column;
    width: min(380px, 92vw);
    background: var(--ds-bg-subtle);
    border-left: 1px solid var(--ds-border);
    box-shadow: var(--ds-shadow-lg);
}

.agent-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid var(--ds-border-subtle);
}

.agent-drawer__meta {
    min-width: 0;
}

.agent-drawer__heading {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ds-text);
}

.agent-drawer__name {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-accent);
}

.agent-drawer__desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--ds-text-muted);
}

.agent-drawer__close {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: var(--ds-radius);
    background: transparent;
    color: var(--ds-text-muted);
    font-size: 18px;
    cursor: pointer;
}

.agent-drawer__close:hover {
    background: var(--ds-surface-hover);
    color: var(--ds-text);
}

.agent-drawer__scope {
    display: flex;
    gap: 6px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--ds-border-subtle);
}

.agent-drawer__scope button {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    background: transparent;
    color: var(--ds-text-muted);
    font-size: 12.5px;
    cursor: pointer;
    transition: background var(--ds-duration) var(--ds-ease),
        border-color var(--ds-duration) var(--ds-ease),
        color var(--ds-duration) var(--ds-ease);
}

.agent-drawer__scope button.active {
    background: var(--ds-accent-soft);
    border-color: var(--ds-accent-border);
    color: var(--ds-accent);
}

.agent-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 18px 20px;
}

.agent-drawer__loading {
    margin: 12px 0 0;
    color: var(--ds-text-muted);
    font-size: 13px;
}

.agent-drawer__section {
    padding: 14px 0;
    border-bottom: 1px solid var(--ds-border-subtle);
}

.agent-drawer__section:last-child {
    border-bottom: none;
}

.agent-drawer__section h3 {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-text);
}

.agent-drawer__hint {
    margin: 0 0 10px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--ds-text-faint);
}

.agent-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.agent-field:last-child {
    margin-bottom: 0;
}

.agent-field--block {
    margin-top: 8px;
}

.agent-field__label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--ds-text-secondary);
}

.agent-field__label em {
    overflow: hidden;
    font-style: normal;
    font-size: 11px;
    color: var(--ds-text-faint);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-field select,
.agent-field input,
.agent-field textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 7px 9px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-surface);
    color: var(--ds-text);
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
}

.agent-field select:focus,
.agent-field input:focus,
.agent-field textarea:focus {
    border-color: var(--ds-accent-border);
    box-shadow: var(--ds-focus-ring);
}

.agent-field select:disabled,
.agent-field input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.agent-field textarea {
    min-height: 64px;
    line-height: 1.5;
    resize: vertical;
}

.agent-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: var(--ds-text-secondary);
    font-size: 12.5px;
    cursor: pointer;
}

.agent-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--ds-accent);
}

.agent-empty {
    margin: 0;
    color: var(--ds-text-faint);
    font-size: 12px;
}

.agent-drawer__footer {
    display: flex;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--ds-border-subtle);
}

.agent-drawer__btn {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    color: var(--ds-text);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ds-duration) var(--ds-ease),
        box-shadow var(--ds-duration) var(--ds-ease),
        filter var(--ds-duration) var(--ds-ease);
}

.agent-drawer__btn:hover {
    background: var(--ds-surface-hover);
}

.agent-drawer__btn--ghost {
    background: transparent;
    color: var(--ds-text-muted);
}

.agent-drawer__btn--primary {
    background: var(--ds-gradient-accent);
    border-color: transparent;
    color: var(--ds-accent-contrast);
}

.agent-drawer__btn--primary:hover {
    filter: brightness(1.06);
    box-shadow: var(--ds-shadow-accent);
}

.agent-drawer__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .agent-drawer {
        width: 100%;
    }
}

/* ── 移动端：紧凑头像 ── */

@media (max-width: 768px) {
    .main-area {
        --msg-avatar-size: 28px;
        --msg-aside-width: 28px;
        --msg-gap: 8px;
        --msg-side-gutter: 12px;
        --msg-header-name-size: 12px;
        --msg-header-time-size: 10.5px;
        --msg-header-gap: 1px;
    }

    .msg-row {
        gap: var(--msg-gap);
    }

    .msg-header {
        margin-bottom: 6px;
    }

    .msg-header-text {
        min-height: var(--msg-avatar-size);
    }

    .msg-avatar {
        border-radius: 10px;
        font-size: 12px;
    }

    .msg-sender {
        font-size: 12px;
    }

    .msg-time {
        font-size: 10.5px;
    }
}
