/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6c757d;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.nav-btn.active {
    background-color: #007bff;
    color: white;
}

/* Main Content */
.main {
    padding: 2rem 0;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.input, .textarea, .select {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: #007bff;
}

.textarea {
    resize: vertical;
    min-height: 100px;
}

/* File Upload */
.file-upload-area {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #007bff;
}

.file-upload-area.dragover {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.8rem;
    color: #6c757d;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-name {
    font-size: 0.9rem;
    color: #495057;
}

.file-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
}

/* Agent Selection */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.agent-card {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agent-card:hover {
    border-color: #007bff;
}

.agent-card.selected {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.agent-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.agent-description {
    font-size: 0.9rem;
    color: #6c757d;
}

.agent-badge {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-top: 0.5rem;
}

.agent-badge.custom {
    background-color: #d4edda;
    color: #155724;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #545b62;
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.form-actions .btn-secondary {
    background-color: #28a745;
}

.form-actions .btn-secondary:hover {
    background-color: #218838;
}

/* Discussions List */
.discussions-list {
    display: grid;
    gap: 1rem;
}

.discussion-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.discussion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.discussion-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.discussion-question {
    color: #6c757d;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.discussion-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.discussion-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-running {
    background-color: #cce5ff;
    color: #004085;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #6c757d;
}

.status-dot.online {
    background-color: #28a745;
}

.status-dot.offline {
    background-color: #dc3545;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

/* Discussion Detail */
.discussion-info {
    margin-bottom: 2rem;
}

.discussion-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #e9ecef;
}

.message.opening {
    border-left-color: #6f42c1;
    background-color: #f8f7ff;
}

.message.discussion {
    border-left-color: #28a745;
    background-color: #f8fff9;
}

.message.interaction {
    border-left-color: #fd7e14;
    background-color: #fff8f0;
}

.message.moderation {
    border-left-color: #007bff;
    background-color: #f8f9ff;
}

.message.continue_start {
    border-left-color: #20c997;
    background-color: #f0fff4;
    border: 2px solid #20c997;
}

.message.continue_start .message-content {
    font-weight: 600;
    color: #155724;
}

.message.error {
    border-left-color: #dc3545;
    background-color: #fff8f8;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-author {
    font-weight: 600;
    color: #2c3e50;
}

.message-type {
    font-size: 0.75rem;
    background-color: rgba(0, 0, 0, 0.1);
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    margin: 0 0.5rem;
}

.message-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.message-content {
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Discussion Controls */
.discussion-controls {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.discussion-controls .btn-secondary {
    background-color: #17a2b8;
}

.discussion-controls .btn-secondary:hover {
    background-color: #138496;
}

.round-info {
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.continue-info {
    font-size: 0.85rem;
    color: #20c997;
    font-weight: normal;
    margin-left: 0.5rem;
}

/* Markdown渲染样式 */
.markdown-content {
    line-height: 1.6;
    color: #333;
    font-size: 0.95rem;
}

.markdown-content h1 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.8rem;
}

.markdown-content h2 {
    color: #34495e;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 0.3rem;
    margin: 1.3rem 0 0.8rem 0;
    font-size: 1.4rem;
}

.markdown-content h3 {
    color: #2c3e50;
    margin: 1.2rem 0 0.6rem 0;
    font-size: 1.2rem;
    border-left: 4px solid #f39c12;
    padding-left: 0.8rem;
}

.markdown-content h4 {
    color: #34495e;
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem;
}

.markdown-content strong {
    color: #2c3e50;
    font-weight: 600;
}

.markdown-content em {
    color: #7f8c8d;
    font-style: italic;
}

.markdown-content ul {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin: 0.3rem 0;
    line-height: 1.5;
}

.markdown-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    color: #e74c3c;
}

.markdown-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    overflow-x: auto;
    margin: 1rem 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #2c3e50;
}

.markdown-content .checkbox {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
}

.markdown-content .checkbox input {
    margin-right: 0.5rem;
}

.markdown-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, #3498db, #e74c3c, #f39c12);
    margin: 2rem 0;
    border-radius: 1px;
}

.markdown-content .emoji {
    font-size: 1.2em;
    margin: 0 0.2rem;
}

.markdown-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px dotted #3498db;
}

.markdown-content a:hover {
    color: #2980b9;
    border-bottom-style: solid;
}

/* 总结报告特殊样式 */
.summary-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.summary-content::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* Continue Discussion Form */
.continue-discussion-form {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #dee2e6;
}

.continue-discussion-form h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.continue-discussion-form .form-group {
    margin-bottom: 1rem;
}

.continue-discussion-form .form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.btn-info:hover {
    background-color: #138496;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
}

/* Progress Bar Styles */
.progress-bar, .progress-bar-large {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
}

.progress-bar {
    height: 20px;
    width: 200px;
}

.progress-bar-large {
    height: 30px;
    width: 300px;
    margin: 0 auto 1.5rem auto;
}

.progress-fill, .progress-fill-large {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text, .progress-text-large {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.progress-text-large {
    font-size: 1rem;
}

@keyframes progressFlow {
    0% {
        background-position: 200% 0;
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        background-position: -200% 0;
        width: 100%;
    }
}

.loading-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Button Loading States */
.btn-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.btn-loading .progress-bar {
    width: 150px;
    height: 3px;
    margin: 0.5rem 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #007bff;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .agent-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .discussion-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } 