/* 全局样式 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --error-color: #f5222d;
    --warning-color: #fa8c16;
    --info-color: #1890ff;
    --success-color: #52c41a;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #fafafa;
    --border-color: #e8e8e8;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    background: #f0f2f5;
}

/* ================= 客户系统模拟界面 ================= */
.customer-system {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}
.cs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 48px;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.cs-toolbar-left, .cs-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    margin-left: 8px;
}
.cs-breadcrumb .active { color: #1890ff; font-weight: 600; }
.cs-breadcrumb i { font-size: 10px; color: #bbb; }
.cs-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    transition: all 0.2s;
}
.cs-btn:hover { border-color: #1890ff; color: #1890ff; }
.cs-btn-back { border: none; background: transparent; }
/* 红色【优化建议】按钮 —— 高亮显示，带边框呼吸 */
.cs-btn-optimize {
    background: #fff;
    border: 2px solid #ff4d4f !important;
    color: #ff4d4f !important;
    font-weight: 600;
    animation: pulseRed 2s infinite;
    position: relative;
}
.cs-btn-optimize:hover {
    background: #ff4d4f !important;
    color: white !important;
}
@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(255, 77, 79, 0); }
}
.cs-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}
.cs-sidebar {
    width: 180px;
    border-right: 1px solid #e8e8e8;
    padding: 12px;
    background: #fafafa;
    overflow-y: auto;
}
.cs-shape-group { margin-bottom: 16px; }
.cs-shape-title {
    font-size: 12px;
    color: #666;
    padding: 4px 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 8px;
}
.cs-shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.cs-shape {
    aspect-ratio: 1;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: grab;
    transition: all 0.2s;
}
.cs-shape:hover { border-color: #1890ff; color: #1890ff; }
.cs-canvas {
    flex: 1;
    background: #fff;
    position: relative;
    overflow: auto;
    background-image:
        linear-gradient(to right, #f0f0f0 1px, transparent 1px),
        linear-gradient(to bottom, #f0f0f0 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 24px;
}
.cs-canvas-grid {
    width: 900px;
    height: 500px;
    border: 1px solid #333;
    background: white;
    display: flex;
    flex-direction: column;
}
.cs-flow-box {
    flex: 1;
    border-bottom: 1px solid #333;
    position: relative;
    padding-left: 40px;
}
.cs-flow-box:last-child { border-bottom: none; }
.cs-flow-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center;
    font-size: 12px;
    color: #333;
    writing-mode: vertical-rl;
    text-orientation: upright;
    width: 40px;
    text-align: center;
}
.cs-tabs-bottom {
    display: flex;
    border-top: 1px solid #e8e8e8;
    background: #fafafa;
    padding: 0 16px;
}
.cs-tab {
    padding: 8px 20px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    border-right: 1px solid #e8e8e8;
}
.cs-tab.active {
    background: #fff;
    color: #1890ff;
    font-weight: 600;
}

/* 旧集成按钮（保留兼容，已被工具栏内按钮替代） */
.integrate-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transition: var(--transition);
    z-index: 9998;
}
.integrate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* ================= 右侧滑出式助手抽屉 ================= */
.process-optimization-assistant {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 180px; /* 排除左侧导航栏（形状面板） */
    background: var(--bg-primary);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
    border-radius: 12px 0 0 12px;
}
.process-optimization-assistant.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* 头部样式 */
.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title i {
    font-size: 20px;
    color: var(--primary-color);
}

.header-title h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 6px;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 标签页内容 */
.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

/* 统计概览 */
.overview-section {
    padding: 20px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.error {
    border-left: 4px solid var(--error-color);
}

.stat-card.warning {
    border-left: 4px solid var(--warning-color);
}

.stat-card.info {
    border-left: 4px solid var(--info-color);
}

.stat-card.score {
    border-left: 4px solid var(--success-color);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card.error .stat-value { color: var(--error-color); }
.stat-card.warning .stat-value { color: var(--warning-color); }
.stat-card.info .stat-value { color: var(--info-color); }
.stat-card.score .stat-value { color: var(--success-color); }

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-actions {
    display: flex;
    gap: 12px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
}

.btn-secondary {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

/* 筛选区域 */
.filter-section {
    padding: 16px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-chips {
    display: flex;
    gap: 8px;
}

.chip {
    cursor: pointer;
}

.chip input {
    display: none;
}

.chip-label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.chip input:checked + .chip-label {
    border-color: currentColor;
}

.chip-label.error {
    color: var(--error-color);
    background: rgba(245, 34, 45, 0.1);
}

.chip-label.warning {
    color: var(--warning-color);
    background: rgba(250, 140, 22, 0.1);
}

.chip-label.info {
    color: var(--info-color);
    background: rgba(24, 144, 255, 0.1);
}

#category-filter {
    min-width: 200px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-primary);
}

#search-check {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    width: 200px;
}

#search-check:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 检查清单表格 */
.checklist-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-container {
    flex: 1;
    overflow: auto;
    padding: 0 24px;
}

.checklist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.checklist-table th {
    background: var(--bg-tertiary);
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

.checklist-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.4;
}

.checklist-table tr:hover {
    background: var(--bg-tertiary);
}

/* 表格页脚 */
.table-footer {
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.pagination-info {
    font-size: 12px;
    color: var(--text-light);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#page-info {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 诊断摘要 */
.diagnosis-summary {
    padding: 20px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.diagnosis-summary h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.diagnosis-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.diagnosis-card {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.diagnosis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.diagnosis-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.diagnosis-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.diagnosis-content p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* 智能问答样式 */
.qa-mode-section {
    padding: 20px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.mode-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.mode-title h4 {
    font-size: 16px;
    color: var(--text-primary);
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.mode-option {
    position: relative;
}

.mode-option input {
    display: none;
}

.mode-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.mode-option input:checked + .mode-label {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.mode-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.mode-info {
    flex: 1;
}

.mode-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.mode-desc {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.3;
}

.mode-tips {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(82, 196, 26, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: var(--success-color);
}

/* 问答历史 */
.qa-history-section {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.ai {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--success-color), #73d13d);
    color: white;
}

.message-content {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
    max-width: 100%;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.message.user .sender {
    color: white;
}

.time {
    font-size: 11px;
    color: var(--text-light);
}

.message.user .time {
    color: rgba(255, 255, 255, 0.8);
}

.message-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.message.user .message-text {
    color: white;
}

.message-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin-bottom: 4px;
}

/* 输入区域 */
.qa-input-section {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.input-container {
    position: relative;
    margin-bottom: 12px;
}

#question-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

#question-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.input-tools {
    display: flex;
    gap: 8px;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.tool-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-send {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
}

.quick-questions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-questions span {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.quick-btn {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.quick-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(24, 144, 255, 0.05);
}

/* 底部状态栏 */
.assistant-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.process-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.info-item i {
    color: var(--text-secondary);
}

.info-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.info-item code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
}

.footer-actions {
    display: flex;
    gap: 8px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius);
    width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.modal-content.large {
    width: 700px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 示例问题模态框 */
.example-category {
    margin-bottom: 20px;
}

.example-category h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.example-question {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.example-question:hover {
    border-color: var(--primary-color);
    background: rgba(24, 144, 255, 0.05);
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .process-optimization-assistant {
        left: 0; /* 小屏时不再预留左侧导航栏宽度 */
    }
}

@media (max-width: 768px) {
    .assistant-header {
        flex-wrap: wrap;
        height: auto;
        padding: 12px;
    }
    
    .header-tabs {
        order: 3;
        width: 100%;
        margin-top: 12px;
    }
    
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .diagnosis-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mode-options {
        grid-template-columns: 1fr;
    }
    
    .assistant-footer {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ================= 补充样式：徽章 / 详情 / Loading / Toast ================= */
/* 严重程度徽章 */
.severity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.severity-badge.error { background: rgba(245,34,45,0.1); color: #f5222d; border: 1px solid rgba(245,34,45,0.3); }
.severity-badge.warning { background: rgba(250,140,22,0.1); color: #fa8c16; border: 1px solid rgba(250,140,22,0.3); }
.severity-badge.info { background: rgba(24,144,255,0.1); color: #1890ff; border: 1px solid rgba(24,144,255,0.3); }

.btn-link {
    background: transparent;
    border: none;
    color: #1890ff;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: var(--transition);
}
.btn-link:hover { background: rgba(24,144,255,0.1); }
.text-light { color: #bbb; font-size: 11px; }
.empty-row td {
    text-align: center;
    padding: 40px !important;
    color: #999;
}
.check-item.error { border-left: 3px solid rgba(245,34,45,0.5); }
.check-item.warning { border-left: 3px solid rgba(250,140,22,0.5); }
.check-item.info { border-left: 3px solid rgba(24,144,255,0.5); }

/* 详情面板 */
.detail-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.detail-section:last-child { border-bottom: none; }
.detail-section h4 {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.detail-item.full { grid-column: 1 / -1; }
.detail-item label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}
.detail-item span, .detail-item p {
    font-size: 13px;
    color: #333;
    line-height: 1.6;
}
.description-box, .regulation-box, .suggestion-box {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.6;
}
.description-box { background: #fff7e6; border-left: 3px solid #fa8c16; color: #873800; }
.regulation-box { background: #f0f5ff; border-left: 3px solid #1890ff; color: #003a8c; }
.suggestion-box { background: #f6ffed; border-left: 3px solid #52c41a; color: #135200; }

/* 问答消息附加样式 */
.message-modes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.mode-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(24,144,255,0.1);
    color: #1890ff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.message-sources {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    font-size: 11px;
    color: #999;
}
.message-sources .source {
    display: inline-block;
    padding: 1px 6px;
    margin: 0 4px 2px 0;
    background: rgba(0,0,0,0.05);
    border-radius: 3px;
    color: #666;
}
.message.user .message-sources,
.message.user .message-sources .source { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.15); }

/* ==================== 知识库引用卡片 ==================== */
.kb-citations {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.12);
}
.kb-citations-title {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.kb-citations-title i { color: #1890ff; }
.kb-citations-title .kb-count {
    background: #1890ff;
    color: #fff;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}
.kb-citation {
    background: linear-gradient(180deg, #f7fbff 0%, #fff 100%);
    border: 1px solid #d9e8fb;
    border-left: 3px solid #1890ff;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 12px;
    transition: all .2s;
}
.kb-citation:hover {
    box-shadow: 0 2px 8px rgba(24,144,255,0.15);
    transform: translateY(-1px);
}
.kb-citation-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.kb-index {
    color: #1890ff;
    font-weight: 700;
    font-size: 11px;
}
.kb-type {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: #e6f7ff;
    color: #1890ff;
}
.kb-type-law { background: #fff1f0; color: #cf1322; }
.kb-type-spec { background: #f0f5ff; color: #2f54eb; }
.kb-type-doc { background: #f6ffed; color: #389e0d; }
.kb-type-report { background: #fff7e6; color: #d46b08; }
.kb-title {
    font-weight: 600;
    color: #222;
    font-size: 12px;
}
.kb-section {
    color: #888;
    font-size: 11px;
}
.kb-snippet {
    color: #444;
    line-height: 1.65;
    margin: 4px 0 6px;
    padding-left: 4px;
    border-left: 2px solid #e6f0ff;
    padding: 2px 8px;
}
.kb-snippet mark {
    background: #fff2b8;
    color: #333;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}
.kb-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #1890ff;
    text-decoration: none;
    font-weight: 500;
}
.kb-link:hover { color: #096dd9; text-decoration: underline; }
.kb-ref {
    display: inline-block;
    color: #1890ff;
    font-weight: 700;
    font-size: 10px;
    padding: 0 2px;
    margin: 0 1px;
    vertical-align: super;
}
.kb-ref:hover { color: #096dd9; text-decoration: underline; }
.message.user .kb-citations { display: none; }

/* 知识库原文弹窗 */
.kb-doc-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0 14px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 14px;
    font-size: 12px;
}
.kb-doc-meta .kb-doc-id {
    color: #999;
    margin-left: auto;
    font-family: Menlo, Consolas, monospace;
    font-size: 11px;
}
.kb-doc-body { font-size: 13px; line-height: 1.75; color: #333; }
.kb-doc-body h4 { font-size: 14px; color: #1890ff; margin: 14px 0 6px; font-weight: 600; }
.kb-doc-body p { margin: 6px 0; }
.kb-doc-body ol, .kb-doc-body ul { padding-left: 22px; margin: 6px 0; }
.kb-doc-body li { margin: 3px 0; }
.kb-doc-body table { width: 100%; margin: 8px 0; }

/* ==================== 知识库范围选择 ==================== */
.kb-type-flow { background: #fff0f6; color: #c41d7f; }
.kb-type-image { background: #f6ffed; color: #389e0d; }

.kb-scope-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin-left: 4px;
    font-size: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 14px;
    background: #fff;
    color: #595959;
    cursor: pointer;
    transition: all .2s;
    height: 26px;
    line-height: 1;
}
.kb-scope-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #f0f9ff;
}
.kb-scope-btn.has-selected {
    border-color: #1890ff;
    color: #1890ff;
    background: #e6f7ff;
}
.kb-scope-btn .scope-prefix { color: #999; font-size: 11px; }
.kb-scope-btn .scope-summary { font-weight: 600; }
.kb-scope-btn .fa-caret-down { font-size: 10px; opacity: .7; }

.kb-scope-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #f0f9ff 0%, #fafbfc 100%);
    border: 1px solid #d6e4ff;
    border-radius: 6px 6px 0 0;
    border-bottom: none;
    margin-bottom: -1px;
    align-items: center;
}
.kb-scope-chips-label {
    font-size: 11px;
    color: #1890ff;
    font-weight: 600;
    margin-right: 4px;
}
.kb-scope-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 6px;
    background: #fff;
    color: #1890ff;
    border: 1px solid #91d5ff;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(24, 144, 255, 0.08);
}
.kb-scope-chip i.fa-times {
    cursor: pointer;
    font-size: 10px;
    color: #bfbfbf;
    margin-left: 2px;
    padding: 2px;
    border-radius: 50%;
    transition: all .15s;
}
.kb-scope-chip i.fa-times:hover { color: #fff; background: #ff4d4f; }
.kb-scope-chip .chip-icon { font-size: 11px; }
.kb-scope-chip-more {
    color: #8c8c8c;
    font-size: 11px;
    cursor: pointer;
    padding: 0 4px;
}
.kb-scope-chip-more:hover { color: #1890ff; }

.kb-scope-popover {
    display: none;
    position: fixed;
    width: 420px;
    max-height: 560px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.16);
    z-index: 10001;
    flex-direction: column;
    overflow: hidden;
    animation: kbScopeFadeIn .18s ease-out;
}
.kb-scope-popover.active { display: flex; }
@keyframes kbScopeFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.kb-scope-search {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fafafa;
}
.kb-scope-search .fa-search { color: #bfbfbf; font-size: 12px; }
.kb-scope-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 12px;
    outline: none;
    color: #333;
}

.kb-scope-tabs {
    display: flex;
    padding: 0 12px;
    gap: 2px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    overflow-x: auto;
}
.kb-tab {
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .15s;
}
.kb-tab:hover { color: #1890ff; }
.kb-tab.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
    font-weight: 600;
}

.kb-scope-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 8px;
    min-height: 200px;
    max-height: 360px;
}
.kb-scope-section-title {
    padding: 8px 14px 4px;
    font-size: 11px;
    color: #999;
    font-weight: 600;
    letter-spacing: .5px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.kb-scope-recommend {
    background: linear-gradient(180deg, #fff7e6 0%, #fffbe6 100%);
    border-bottom: 1px solid #ffe58f;
    padding-bottom: 4px;
}
.kb-scope-recommend .kb-scope-section-title { color: #d46b08; }
.kb-scope-rec-item, .kb-scope-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 12px;
    transition: background .15s;
    color: #333;
}
.kb-scope-rec-item:hover, .kb-scope-node-row:hover {
    background: rgba(24, 144, 255, 0.06);
}
.kb-scope-rec-item input, .kb-scope-node-row input {
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.kb-scope-rec-item .scope-icon, .kb-scope-node-row .scope-icon {
    color: #8c8c8c;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}
.kb-scope-node-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kb-scope-node-name mark {
    background: #fff2b8;
    padding: 0 2px;
    border-radius: 2px;
    color: #d46b08;
}
.kb-scope-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1.4;
}
.tag-current { background: #fff2b8; color: #d46b08; }
.tag-up { background: #e6f7ff; color: #1890ff; }
.tag-down { background: #f6ffed; color: #52c41a; }
.kb-scope-empty {
    padding: 28px 12px;
    text-align: center;
    color: #bfbfbf;
    font-size: 12px;
}

.kb-scope-footer {
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fafafa;
}
.kb-scope-count {
    font-size: 12px;
    color: #666;
}
.kb-scope-text-btn {
    background: none;
    border: none;
    color: #1890ff;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
}
.kb-scope-text-btn:hover { background: #e6f7ff; }
.kb-scope-confirm-btn {
    margin-left: auto;
    padding: 6px 16px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background .15s;
}
.kb-scope-confirm-btn:hover { background: #096dd9; }

.message-text ol { padding-left: 20px; margin: 8px 0; }
.message-text ol li { margin-bottom: 4px; }
.message-text p { margin: 6px 0; }
.message-text .tag-error { color: #f5222d; font-weight: 600; }
.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 8px 0;
    background: #fff;
}
.mini-table th, .mini-table td {
    padding: 6px 10px;
    border: 1px solid #e8e8e8;
    text-align: left;
}
.mini-table th { background: #fafafa; font-weight: 600; }

/* Loading 圆点动效 */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-right: 8px;
}
.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    animation: bounceDot 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}
.thinking-text { font-size: 12px; color: #999; }

/* 全局 Loading 蒙层 */
.assistant-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 100;
    backdrop-filter: blur(2px);
}
.loading-spinner {
    font-size: 40px;
    color: var(--primary-color);
}
.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Toast 全局提示 */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 10px 18px;
    background: #333;
    color: white;
    border-radius: 4px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #52c41a; }
.toast-warning { background: #fa8c16; }
.toast-error { background: #f5222d; }
.toast-info { background: #1890ff; }

/* 抽屉左上圆角继续保留 */
.process-optimization-assistant {
    transform-origin: right center;
}

/* ================= 右上角【智能工具】固定按钮 ================= */
.smart-tool-btn {
    position: fixed;
    top: 10px;
    right: 16px;
    z-index: 10000;
    padding: 7px 14px 7px 12px;
    background: linear-gradient(135deg, #1890ff, #40a9ff);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(24, 144, 255, 0.38);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    user-select: none;
}
.smart-tool-btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 6px 20px rgba(24, 144, 255, 0.5);
    filter: brightness(1.08);
}
.smart-tool-btn:active { transform: translateY(0) scale(0.98); }
.smart-tool-btn i { font-size: 14px; }
.smart-tool-badge {
    display: inline-block;
    padding: 0 6px;
    margin-left: 2px;
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 14px;
}

/* ================= 抽屉遮罩 ================= */
.assistant-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(1px);
}
.assistant-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ================= 常驻浮标（已废弃，隐藏兑底兼容） ================= */
.assistant-floater {
    display: none !important;
}

/* ================= 浮窗模式控制 ================= */
/* 全功能模式（点击优化建议触发） */
.process-optimization-assistant.mode-full {
    /* 抽屉形态下完全由外层 position 控制尺寸，这里不再限定宽高 */
}
/* QA-only 模式 - 抽屉形态下同样擑满抽屉，仅隐藏非 QA 内容 */
.process-optimization-assistant.mode-qa {
    /* 尺寸由外层 position 控制 */
}
.process-optimization-assistant.mode-qa .tab-btn[data-tab="checklist"],
.process-optimization-assistant.mode-qa #checklist-content,
.process-optimization-assistant.mode-qa .assistant-footer .footer-actions,
.process-optimization-assistant.mode-qa .process-info .info-item:nth-child(n+2) {
    display: none !important;
}
.process-optimization-assistant.mode-qa .header-tabs { display: none; }
.process-optimization-assistant.mode-qa .header-title h2 {
    font-size: 16px;
}
.process-optimization-assistant.mode-qa #qa-content { display: flex; }
.process-optimization-assistant.mode-qa .qa-mode-section { padding: 12px 16px; }
.process-optimization-assistant.mode-qa .mode-options { grid-template-columns: 1fr; gap: 6px; }
.process-optimization-assistant.mode-qa .mode-label { padding: 8px 12px; }
.process-optimization-assistant.mode-qa .mode-icon { width: 28px; height: 28px; font-size: 13px; }
.process-optimization-assistant.mode-qa .mode-name { font-size: 13px; }
.process-optimization-assistant.mode-qa .mode-desc { font-size: 11px; }
.process-optimization-assistant.mode-qa .qa-history-section { padding: 12px 16px; }
.process-optimization-assistant.mode-qa .qa-input-section { padding: 10px 16px; }

/* ================= 统计卡紧凑版 ================= */
.overview-section.compact {
    padding: 10px 16px;
}
.overview-stats.compact {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}
.overview-stats.compact .stat-card {
    padding: 8px 10px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.overview-stats.compact .stat-card:hover { transform: none; }
.overview-stats.compact .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
}
.overview-stats.compact .stat-value {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.overview-actions.compact {
    gap: 6px;
}
.overview-actions.compact .btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ================= 分类 Tab 栏 ================= */
.category-tabs {
    display: flex;
    gap: 2px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    white-space: nowrap;
}
.category-tabs::-webkit-scrollbar { height: 4px; }
.category-tabs::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 2px; }
.category-tab {
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.category-tab:hover { color: var(--primary-color); }
.category-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}
.category-tab .cat-count {
    padding: 1px 6px;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 10px;
    color: #999;
    font-weight: normal;
}
.category-tab.active .cat-count {
    background: rgba(24,144,255,0.15);
    color: var(--primary-color);
}

/* ================= 诊断摘要紧凑版 ================= */
.diagnosis-summary {
    padding: 10px 16px 14px;
}
.diagnosis-summary h3 {
    font-size: 13px;
    margin-bottom: 10px;
}
.diagnosis-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.diagnosis-card {
    padding: 8px 10px;
    gap: 8px;
}
.diagnosis-card:hover { transform: none; }
.diagnosis-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 6px;
    flex-shrink: 0;
}
.diagnosis-content h4 {
    font-size: 12px;
    margin-bottom: 2px;
}
.diagnosis-content p {
    font-size: 11px;
    line-height: 1.3;
}

/* ================= 整体滚动支持 ================= */
.tab-content.active {
    display: flex;
    overflow-y: auto;
    overflow-x: hidden;
}
.checklist-section {
    flex: none;
    min-height: 200px;
}
.table-container {
    max-height: 360px;
    overflow: auto;
}
.filter-section {
    padding: 10px 16px;
    gap: 10px;
}
.filter-section label { font-size: 12px; }
#search-check { width: 160px; padding: 4px 10px; }
#category-filter { min-width: 180px; padding: 4px 10px; font-size: 12px; height: 80px; }

/* 表格页脚紧凑 */
.table-footer {
    padding: 8px 16px;
}

/* 助手底部紧凑 */
.assistant-footer {
    padding: 8px 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.assistant-footer .info-item { font-size: 11px; }
.assistant-footer .btn-small { padding: 3px 8px; font-size: 11px; }

/* ================= 底部状态栏单行版 ================= */
.assistant-footer.compact {
    padding: 6px 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
}
.assistant-footer.compact .process-info {
    gap: 14px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.assistant-footer.compact .info-item {
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.assistant-footer.compact .info-item i { font-size: 11px; }
.assistant-footer.compact .info-item code {
    padding: 1px 4px;
    font-size: 10px;
}
.assistant-footer.compact .info-item strong { font-weight: 600; }

/* ================= QA Tab 对话为主（底部chip模式） ================= */
/* 历史区占据绝大部分高度 */
#qa-content.tab-content.active { display: flex; flex-direction: column; }
#qa-content .qa-history-section {
    flex: 1 1 auto;
    min-height: 280px;
    padding: 16px 20px;
}
#qa-content .qa-input-section {
    flex: 0 0 auto;
    padding: 10px 16px;
    background: var(--bg-primary);
}
#qa-content .input-container { margin-bottom: 6px; }
#qa-content #question-input {
    padding: 8px 12px;
    font-size: 13px;
}
#qa-content .input-actions { margin-top: 6px; gap: 8px; }
#qa-content .input-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
#qa-content .tool-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
#qa-content .btn-send {
    padding: 6px 16px;
    font-size: 12px;
    height: 30px;
}
#qa-content .quick-questions { margin-top: 4px; }
#qa-content .quick-btn { padding: 2px 10px; font-size: 11px; }

/* 模式chip（发送按钮左侧） */
.mode-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    height: 28px;
}
.mode-chip input { display: none; }
.mode-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid #d9d9d9;
    border-radius: 14px;
    font-size: 11px;
    line-height: 1;
    color: #666;
    background: #fff;
    transition: all 0.2s;
    white-space: nowrap;
}
.mode-chip span i { font-size: 11px; }
.mode-chip:hover span {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.mode-chip input:checked + span {
    background: rgba(24,144,255,0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}
.mode-chip input:checked + span i { color: var(--primary-color); }

/* 工具栏分隔线 */
.tools-divider {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #e8e8e8;
    margin: 0 4px;
}



