:root {
    --primary-color: #1e3a5f;
    --primary-light: #3d5a80;
    --secondary-color: #f0ebe0;
    --accent-color: #c8963e;
    --bg-color: #fafaf7;
    --text-color: #2c2c2a;
    --text-light: #8a8a85;
    --white: #ffffff;
    --sidebar-bg: #f5f2eb;
    --bot-msg-bg: #f5f4f0;
    --user-msg-bg: #1e3a5f;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    --border-radius: 20px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Nunito', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
        radial-gradient(#f0ebe0 2px, transparent 2px),
        radial-gradient(#c8963e 2px, transparent 2px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    overflow: hidden;
}

.app-wrapper {
    width: 95vw;
    height: 90vh;
    max-width: 1200px;
    background-color: var(--white);
    border-radius: 30px;
    box-shadow: var(--shadow);
    display: flex;
    overflow: hidden;
    border: 1px solid var(--secondary-color);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 10px;
}

.logo-icon {
    font-size: 2rem;
    background: var(--white);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    animation: bounce 3s infinite;
}

.sidebar-header h2 {
    font-family: 'Nunito', 'Microsoft YaHei', sans-serif;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.6);
    transform: translateX(5px);
}

.nav-btn.active {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.nav-btn i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.danger-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: #fce8e8;
    color: #e05555;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.danger-btn:hover {
    background-color: #f5c8c8;
}

.logout-btn {
    margin-top: 10px;
}

.user-badge {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
    font-weight: 600;
}

.user-badge small {
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    position: relative;
}

.auth-panel {
    margin: auto;
    width: min(440px, 88%);
    background: var(--white);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.auth-panel h2 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.auth-panel p {
    color: var(--text-light);
    font-size: 0.92rem;
    margin-bottom: 16px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-form input,
.auth-form select {
    width: 100%;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    outline: none;
}

.auth-form input:focus,
.auth-form select:focus {
    border-color: var(--primary-light);
}

.auth-submit {
    border-radius: 12px !important;
    width: 100% !important;
    height: 44px !important;
}

.auth-switch {
    border: none;
    background: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 700;
    padding-top: 4px;
}

/* Notice Modal Overlay */
.notice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.notice-modal {
    background: var(--white);
    border-radius: 20px;
    padding: 28px 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
}

.notice-modal h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.notice-modal ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.notice-modal li {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-color);
    padding-left: 16px;
    position: relative;
}

.notice-modal li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: 700;
}

.notice-modal li code {
    background: #f0ebe0;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-color);
}

.notice-confirm-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.notice-confirm-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.chat-header {
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: #90ee90;
    border-radius: 50%;
    box-shadow: 0 0 5px #90ee90;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: #f5f5f5;
    color: var(--text-color);
}

/* Chat Area */
.chat-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.welcome-screen {
    text-align: center;
    margin: auto;
    color: var(--text-light);
    animation: fadeIn 1s ease;
}

.big-avatar {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.welcome-screen h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
}

.message-content {
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.message-meta {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
    font-size: 0.85rem;
    color: var(--text-color);
}

.reasoning-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    list-style: none;
}

.reasoning-details summary::-webkit-details-marker {
    display: none;
}

.reasoning-details summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.2s ease;
}

.reasoning-details[open] summary::before {
    transform: rotate(90deg);
}

.reasoning-content {
    margin-top: 6px;
    color: var(--text-color);
}

.trace-line {
    margin-bottom: 6px;
    line-height: 1.5;
}

.sources {
    margin-top: 10px;
}

.sources-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

.sources-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.source-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.source-title-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-weight: 600;
}

.source-file {
    color: var(--primary-color);
}

.source-page {
    color: var(--text-light);
}

.source-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
    font-size: 0.78rem;
}

.source-excerpt {
    margin-top: 4px;
    color: var(--text-color);
    font-size: 0.82rem;
}

.bot-message .message-content {
    background-color: var(--bot-msg-bg);
    color: #444;
    border-bottom-left-radius: 5px;
}

.user-message .message-content {
    background-color: var(--user-msg-bg);
    color: var(--white);
    border-bottom-right-radius: 5px;
}

.user-message .message-content p,
.user-message .message-content h1,
.user-message .message-content h2,
.user-message .message-content h3,
.user-message .message-content h4,
.user-message .message-content h5,
.user-message .message-content h6,
.user-message .message-content li,
.user-message .message-content strong,
.user-message .message-content em {
    color: var(--white);
}

/* Markdown Styles */
.message-content pre {
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    overflow-x: auto;
    border: 1px solid #eee;
}

.message-content code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul, .message-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

/* Input Area */
.input-area-wrapper {
    padding: 20px 30px;
    background-color: var(--white);
    border-top: 1px solid #f0f0f0;
}

.input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 25px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.input-area:focus-within {
    border-color: var(--primary-light);
    background-color: var(--white);
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.1);
}

.attach-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    padding: 10px;
    cursor: pointer;
    transition: var(--transition);
}

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

textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    padding: 10px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    max-height: 100px;
    color: var(--text-color);
}

.send-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(30, 58, 95, 0.25);
}

.send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
    background-color: #152d4a;
}

.footer-text {
    text-align: center;
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 10px;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

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

/* Loading Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 20px;
    background-color: var(--bot-msg-bg);
    border-radius: 20px;
    border-bottom-left-radius: 5px;
    width: fit-content;
    margin-bottom: 20px;
    animation: slideUp 0.3s ease;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #aaa;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .app-wrapper {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    
    .sidebar {
        display: none; /* Hide sidebar on mobile for now or make it collapsible */
    }
}

/* History Sidebar */
.history-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background-color: var(--white);
    border-left: 1px solid #f0f0f0;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 20;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.history-header h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.history-item {
    padding: 15px;
    margin-bottom: 8px;
    border-radius: 12px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-item:hover {
    background-color: var(--secondary-color);
    border-color: var(--primary-light);
    transform: translateX(-3px);
}

.history-item.active {
    background-color: var(--primary-light);
    color: var(--white);
    border-color: var(--primary-color);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.session-title {
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
}

.history-item.active .session-meta {
    color: rgba(255, 255, 255, 0.8);
}

.session-body {
    flex: 1;
}

.history-delete-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: var(--transition);
}

.history-delete-btn:hover {
    background-color: rgba(224, 85, 85, 0.1);
    color: #e05555;
}

.history-item.active .history-delete-btn {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.15);
}

/* Settings Panel */
.settings-panel {
    width: 100%;
    height: 100%;
    padding: 30px;
    overflow-y: auto;
    background-color: var(--bg-color);
}

.settings-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-light);
}

.settings-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.upload-section,
.documents-section {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.upload-section h3,
.documents-section h3 {
    color: var(--text-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.3);
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 12px;
    border: 2px dashed var(--primary-light);
}

.selected-file i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.btn-secondary:hover {
    background-color: #e0dbd0;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #e05555;
    color: var(--white);
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-danger:hover {
    background-color: #c94a4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(224, 85, 85, 0.3);
}

.upload-progress {
    padding: 12px;
    background-color: var(--accent-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.9rem;
    border-left: 4px solid var(--primary-color);
}

.loading-indicator {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 1rem;
}

.empty-documents {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-documents i {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 15px;
    display: block;
}

.empty-documents p {
    font-size: 1.1rem;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background-color: var(--bg-color);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.document-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.document-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.document-icon i {
    font-size: 1.5rem;
}

.document-icon .fa-file-pdf {
    color: #e74c3c;
}

.document-icon .fa-file-word {
    color: #2980b9;
}

.document-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.document-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.document-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.document-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Chat Area Wrapper */
.chat-area {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* Thinking Animation (inside bot bubble) */
.thinking-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 20px !important;
}

.thinking-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thinking-dots {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.tdot {
    width: 7px;
    height: 7px;
    background-color: #aaa;
    border-radius: 50%;
    animation: thinking-bounce 1.4s infinite ease-in-out both;
}

.tdot:nth-child(1) { animation-delay: -0.32s; }
.tdot:nth-child(2) { animation-delay: -0.16s; }
.tdot:nth-child(3) { animation-delay: 0s; }

@keyframes thinking-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.thinking-text {
    color: #999;
    font-size: 0.88rem;
}

/* Thinking trace lines — RAG progress inside thinking bubble */
.thinking-trace-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 4px;
    border-left: 2px solid var(--border-color, #e0e0e0);
    margin-left: 10px;
}

.thinking-trace-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.84rem;
    animation: fadeInTraceLine 0.3s ease;
}

@keyframes fadeInTraceLine {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.thinking-trace-icon {
    flex-shrink: 0;
    font-size: 0.78rem;
}

.thinking-trace-label {
    color: var(--text-color, #333);
    font-weight: 500;
}

.thinking-trace-detail {
    color: var(--text-light, #999);
    font-size: 0.8rem;
    margin-left: 2px;
}

/* Real-time RAG steps */
.rag-steps-live {
    margin-top: 6px;
}

.rag-step-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    animation: fadeInStep 0.3s ease;
}

@keyframes fadeInStep {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

.rag-step-icon {
    flex-shrink: 0;
    font-size: 0.75rem;
}

.rag-step-text {
    color: var(--text-color);
    font-weight: 500;
}

.rag-step-detail {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-left: 4px;
}

/* Stop button */
.stop-btn {
    background-color: #e05555 !important;
    box-shadow: 0 4px 10px rgba(224, 85, 85, 0.3) !important;
}

.stop-btn:hover {
    background-color: #c94a4a !important;
    transform: scale(1.1) !important;
}
