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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    font-size: 18px; /* 进一步增大基础字体大小 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

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

.controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.query-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.query-input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.config-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-group label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.config-group select,
.config-group input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 120px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.trajectory-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    max-height: 1000px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

.trajectory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.trajectory-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.trajectory-controls {
    display: flex;
    gap: 10px;
}

.step {
    background: white;
    margin-bottom: 15px;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #4facfe;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); /* 增大阴影面积和深度 */
    transition: transform 0.2s ease;
}

.step:hover {
    transform: translateX(5px);
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.step-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-timestamp {
    font-size: 16px;
    color: #999;
}

.step-title {
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px; /* 进一步增大标题字体 */
}

.step-number {
    background: #4facfe;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.loading-step {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: #888;
    padding: 20px;
    background-color: #f8f9fa; /* A subtle background for the loading indicator */
    border: none;
    box-shadow: none;
}

.step-type {
    background: #e9ecef;
    color: #666;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.step-content {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 16px; /* 进一步增大内容字体大小 */
}

.step-content strong {
    font-size: inherit; /* 确保strong标签继承父元素的字体大小 */
    font-weight: 600;
}

/* Start steps - Blue theme */
.step-start { border-left-color: #4facfe; box-shadow: 0 6px 24px rgba(79, 172, 254, 0.2); }
.step-start .step-type { background: #4facfe; color: white; }
.step-start .step-number { background: #4facfe; color: white; }

/* Search steps - Green theme */
.step-search { border-left-color: #28a745; box-shadow: 0 6px 24px rgba(40, 167, 69, 0.2); }
.step-search .step-type { background: #28a745; color: white; }
.step-search .step-number { background: #28a745; color: white; }

/* Access steps - Blue theme */
.step-access { border-left-color: #007bff; box-shadow: 0 6px 24px rgba(0, 123, 255, 0.2); }
.step-access .step-type { background: #007bff; color: white; }
.step-access .step-number { background: #007bff; color: white; }

/* Thinking steps - Orange theme */
.step-thinking { border-left-color: #fd7e14; box-shadow: 0 6px 24px rgba(253, 126, 20, 0.2); }
.step-thinking .step-type { background: #fd7e14; color: white; }
.step-thinking .step-number { background: #fd7e14; color: white; }

/* Browsing steps - Purple theme */
.step-browsing { border-left-color: #722ed1; box-shadow: 0 6px 24px rgba(114, 46, 209, 0.2); }
.step-browsing .step-type { background: #722ed1; color: white; }
.step-browsing .step-number { background: #722ed1; color: white; }

/* Summarize steps - Magenta theme */
.step-summarize { border-left-color: #e83e8c; box-shadow: 0 6px 24px rgba(232, 62, 140, 0.2); }
.step-summarize .step-type { background: #e83e8c; color: white; }
.step-summarize .step-number { background: #e83e8c; color: white; }

/* Answer steps - Red theme */
.step-answer { border-left-color: #dc3545; box-shadow: 0 6px 24px rgba(220, 53, 69, 0.2); }
.step-answer .step-type { background: #dc3545; color: white; }
.step-answer .step-number { background: #dc3545; color: white; }

/* Completed steps - Teal theme */
.step-completed { border-left-color: #20c997; box-shadow: 0 6px 24px rgba(32, 201, 151, 0.2); }
.step-completed .step-type { background: #20c997; color: white; }
.step-completed .step-number { background: #20c997; color: white; }

/* Error steps - Dark red theme */
.step-error { border-left-color: #721c24; box-shadow: 0 6px 24px rgba(114, 28, 36, 0.2); }
.step-error .step-type { background: #721c24; color: white; }
.step-error .step-number { background: #721c24; color: white; }

.scrollable-content {
    max-height: 300px; /* 设置最大高度 */
    overflow-y: auto; /* 启用垂直滚动条 */
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 16px; /* 与step-content保持一致的字体大小 */
    padding-right: 8px; /* 为滚动条留出一些空间 */
    
    /* 美化滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Webkit浏览器的滚动条样式 */
.scrollable-content::-webkit-scrollbar {
    width: 8px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Agent运行指示器 */
.agent-running-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.agent-running-text {
    color: #666;
    font-size: 14px;
    margin-right: 10px;
}

.bouncing-dots {
    display: flex;
    gap: 4px;
}

.bouncing-dots .dot {
    width: 8px;
    height: 8px;
    background-color: #007bff;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

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

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

.bouncing-dots .dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.button-wrapper {
    text-align: center;
}

.toggle-button:hover {
    background-color: #e9ecef;
}



.final-answer {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 25px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.3);
}

.final-answer h3 {
    margin-bottom: 15px;
    font-size: 1.4em;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    font-size: 1.1em;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4facfe;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.save-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.saved-trajectories {
    margin-top: 30px;
}

.trajectory-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trajectory-info {
    flex: 1;
}

.trajectory-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.trajectory-meta {
    font-size: 12px;
    color: #666;
}

.trajectory-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .controls {
        grid-template-columns: 1fr;
    }
    
    .config-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .config-group {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}
