/* ========== APRD Chat 完全独立样式 ========== */
/* 变量与 index/theme.css 对齐，值完全一致 */

:root {
    /* 主色 */
    --primary: #f472b6;
    --primary-hover: #ec4899;
    --primary-light: #fce7f3;
    --primary-border: #f9a8d4;
    --primary-ring: rgba(244, 114, 182, 0.15);

    /* 中性 */
    --bg-main: #f5f5f7;
    --bg-white: #ffffff;
    --bg-hover: #f0f0f5;
    --bg-active: #e8e8ed;
    --bg-subtle: #fafafa;

    /* 文字 */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a5e;
    --text-tertiary: #8b8b9e;

    /* 边框 */
    --border: #e5e5ea;
    --border-light: #f0f0f5;
    --border-strong: #d0d0da;

    /* 功能色（chat 独有） */
    --success: #34c759;
    --success-bg: #e8f9ed;
    --warning: #ff9500;
    --warning-bg: #fff4e5;
    --error: #ff3b30;
    --error-bg: #ffeceb;
    --info: #8b5cf6;
    --info-bg: #f0ebff;

    /* 圆角 */
    --border-radius: 10px;
    --border-radius-sm: 8px;
    --border-radius-lg: 14px;

    /* 阴影 */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* 遮罩 */
    --overlay-bg: rgba(0, 0, 0, 0.4);

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace;

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;

    /* 字号 */
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;

    /* 尺寸 */
    --header-height: 44px;
    --line-height-base: 1.5;

    /* 动效 */
    --transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-base: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background: var(--bg-main);
    overflow: hidden;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-size: var(--font-size-sm);
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    background: var(--bg-white);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

/* 滚动条（标准属性在前，WebKit 覆盖在后） */
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.15) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ===== 页面布局 ===== */
.chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    background: var(--bg-white);
}

/* ===== 头部 ===== */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    flex-shrink: 0;
    gap: 12px;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chat-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge {
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary-hover);
    border-radius: 16px;
    font-size: var(--font-size-xs);
    cursor: pointer;
    white-space: nowrap;
}

/* ===== 状态栏 ===== */
.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 40px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-subtle);
    flex-shrink: 0;
    flex-wrap: wrap;
    overflow: hidden;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.status-dot.running {
    background: var(--warning);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#statusText {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.stop-btn {
    padding: 3px 10px;
    background: var(--error);
    color: white;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    display: none;
}

.stop-btn.show { display: inline-block; }

.status-spacer { flex: 1; }

.bg-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.bg-toggle input[type="checkbox"] {
    appearance: none;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: var(--border-strong);
    position: relative;
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
}

.bg-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform var(--transition-fast);
}

.bg-toggle input[type="checkbox"]:checked { background: var(--primary); }
.bg-toggle input[type="checkbox"]:checked::after { transform: translateX(14px); }

.header-btn {
    padding: 4px 10px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.header-btn:hover { background: var(--bg-hover); }

/* ===== 消息区 ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-main);
    min-width: 0;
}

.empty-chat {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    font-size: var(--font-size-sm);
}

.msg { display: flex; margin: 12px 0; min-width: 0; }
.msg.user { justify-content: flex-end; }
.msg.ai { justify-content: flex-start; }

.msg-content {
    max-width: 85%;
    position: relative;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.msg.user .msg-content {
    background: var(--primary);
    color: white;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border-bottom-right-radius: 4px;
}

.msg.ai .msg-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.msg-text {
    font-size: var(--font-size-base);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

.msg-actions {
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.msg-content:hover .msg-actions { opacity: 1; }

.btn-copy {
    padding: 2px 8px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
    color: var(--text-tertiary);
}

.btn-copy:hover { background: var(--bg-hover); color: var(--text-primary); }

.msg.user .btn-copy {
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.3);
    background: transparent;
}

/* ===== 思考轮次 ===== */
.step-round {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-white);
    max-width: 100%;
}

.step-round summary {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-subtle);
    list-style: none;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.step-round summary::-webkit-details-marker { display: none; }
.step-round[open] summary { border-bottom: 1px solid var(--border-light); }
.round-body {
    padding: 12px;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ===== 助手消息 ===== */
.assistant-think {
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.think-text {
    flex: 1;
    line-height: 1.6;
    color: var(--text-secondary);
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ===== 工具调用 ===== */
.tool-call {
    padding: 8px 12px;
    background: var(--info-bg);
    border-left: 3px solid var(--info);
    border-radius: 6px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ===== 工具结果 ===== */
.tool-result summary {
    cursor: pointer;
    font-size: var(--font-size-sm);
    padding: 8px;
    background: var(--bg-subtle);
    border-radius: 6px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.tool-result summary::-webkit-details-marker { display: none; }
.result-data {
    padding: 8px;
    background: var(--bg-subtle);
    border-radius: 6px;
    overflow-x: auto;
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ===== 进度条 ===== */
.progress-box {
    padding: 12px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    max-width: 100%;
}

.progress-label { font-size: var(--font-size-sm); margin-bottom: 8px; color: var(--text-secondary); }

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 11px;
    margin-top: 4px;
    color: var(--text-tertiary);
    text-align: right;
}

/* ===== 通知 ===== */
.notice {
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    overflow-wrap: break-word;
    word-break: break-word;
}

.notice.thinking { background: var(--info-bg); border-left: 3px solid var(--info); }
.notice.done { background: var(--success-bg); border-left: 3px solid var(--success); }
.notice.error { background: var(--error-bg); border-left: 3px solid var(--error); }

/* ===== 回复卡片 ===== */
.reply-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-card);
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.reply-content {
    line-height: 1.7;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ===== 代码块 ===== */
.code-block {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 8px 0;
    max-width: 100%;
}

.code-block summary {
    padding: 8px 12px;
    background: var(--bg-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    font-size: var(--font-size-xs);
    border-bottom: 1px solid var(--border-light);
}

.code-block summary::-webkit-details-marker { display: none; }
.code-lang { font-weight: 600; color: var(--primary); }
.code-lines { color: var(--text-tertiary); }
.code-toggle { margin-left: auto; color: var(--text-tertiary); }
.code-block pre {
    margin: 0;
    padding: 12px;
    background: #1e1e2e;
    overflow-x: auto;
    position: relative;
    max-width: 100%;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: #e5e7eb;
    white-space: pre;
}

.btn-copy-code {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    font-size: 11px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #e5e7eb;
    border-radius: 4px;
}

/* ===== 表格 ===== */
.table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table-wrap th {
    padding: 8px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.table-wrap td {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    overflow-wrap: break-word;
    word-break: break-word;
}

.table-wrap tbody tr:nth-child(even) { background: var(--bg-subtle); }

/* ===== Markdown ===== */
.md-body {
    font-size: var(--font-size-base);
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.md-body h1, .md-body h2, .md-body h3 { margin: 16px 0 8px; font-weight: 600; }
.md-body h1 { font-size: 18px; }
.md-body h2 { font-size: 16px; }
.md-body h3 { font-size: 15px; }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 8px 0; padding-left: 20px; }
.md-body li { margin: 4px 0; }
.md-body blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid var(--primary);
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}
.md-body code:not(pre code) {
    background: #f0f0f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: #d63384;
    word-break: break-all;
}
.md-body pre {
    margin: 8px 0;
    padding: 12px;
    background: #f6f7f9;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    max-width: 100%;
}
.md-body pre code {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: #1f2937;
    background: transparent;
    white-space: pre;
}
.md-body a { color: var(--primary); text-decoration: none; }
.md-body a:hover { color: var(--primary-hover); text-decoration: underline; }
.md-body img { max-width: 100%; border-radius: var(--border-radius-sm); }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.md-body table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
}

/* ===== 输入区 ===== */
.input-area {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: var(--bg-white);
    flex-shrink: 0;
}

.prompt-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.prompt-btn {
    padding: 4px 10px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.prompt-btn:hover { background: var(--bg-hover); }

.selected-prompts {
    display: flex;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.prompt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: 12px;
    font-size: 11px;
    color: var(--primary-hover);
    cursor: pointer;
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-chip .remove { opacity: 0.6; }
.prompt-chip .remove:hover { opacity: 1; }

.prompt-picker {
    position: absolute;
    left: 0;
    bottom: 100%;
    z-index: 100;
    margin-bottom: 6px;
    width: 280px;
    max-height: 40vh;
    overflow-y: auto;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
}

.prompt-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.prompt-picker-item:hover { background: var(--bg-hover); }
.prompt-picker-item.selected { background: var(--primary-light); }

/* ===== 角色 ===== */
.role-bar { margin-bottom: 8px; }

.role-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: left;
}

.role-btn:hover { border-color: var(--primary); }

.role-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    overflow: hidden;
}

.role-avatar img { width: 100%; height: 100%; object-fit: cover; }

.role-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.role-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 输入行 ===== */
.input-row {
    display: flex;
    gap: 8px;
}

#msgInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    resize: none;
    font-size: var(--font-size-base);
    line-height: 1.5;
    min-height: 64px;
    max-height: 200px;
    min-width: 0;
}

#sendBtn {
    padding: 0 20px;
    background: var(--primary);
    color: white;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

#sendBtn:hover { background: var(--primary-hover); }
#sendBtn:disabled { opacity: 0.6; cursor: not-allowed; }

.beian {
    margin-top: 8px;
    text-align: center;
    font-size: 11px;
}

.beian a { color: #aaa; text-decoration: none; }
.beian a:hover { color: #666; }

/* ===== 加载遮罩 ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== 模态框（类名与 index 对齐） ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    width: 600px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title { font-size: 15px; font-weight: 600; }

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    font-size: 18px;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-card-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.modal-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-card-footer button {
    padding: 6px 16px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-cancel {
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-cancel:hover { background: var(--bg-hover); }

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    height: 38px;
}

.form-group textarea {
    height: auto;
    min-height: 120px;
    resize: vertical;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23929292' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-msg {
    font-size: var(--font-size-sm);
    padding: 8px;
    border-radius: 6px;
    display: none;
}

/* ===== 角色选择列表 ===== */
.role-picker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.role-picker-item:hover { border-color: var(--primary); }

.role-picker-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.role-picker-avatar img { width: 100%; height: 100%; object-fit: cover; }

.role-picker-info { min-width: 0; }

.role-picker-name { font-size: var(--font-size-sm); font-weight: 600; }

.role-picker-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 提示词选择项 ===== */
.prompt-picker-add {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 6px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.prompt-picker-add:hover { background: var(--bg-hover); color: var(--primary); }

/* ===== Token 用量（原 chat-core.js 内联样式抽离） ===== */
.token-usage-inline {
    font-size: 11px;
    color: var(--text-tertiary);
    margin: 4px 0;
    text-align: right;
    font-family: var(--font-mono);
}

.token-usage-summary {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    text-align: right;
    font-family: var(--font-mono);
}