/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

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

/* 输入区域 */
.input-section {
    padding: 40px;
    border-bottom: 2px solid #f0f0f0;
}

.input-section h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 1.8em;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#userInput {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#userInput:focus {
    outline: none;
    border-color: #667eea;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    align-self: flex-start;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

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

/* 执行过程区域 */
.execution-section {
    padding: 40px;
    border-bottom: 2px solid #f0f0f0;
}

.execution-section h2 {
    margin-bottom: 30px;
    color: #667eea;
    font-size: 1.8em;
}

/* 流程图样式 */
.graph-container {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.graph {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.graph-node {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px 30px;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.graph-node.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.graph-node.completed {
    border-color: #4caf50;
    background: linear-gradient(135deg, #4caf5015 0%, #45a04915 100%);
}

.graph-node.error {
    border-color: #f44336;
    background: #ffebee;
}

.node-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.node-label {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.node-status {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.graph-arrow {
    font-size: 1.5em;
    color: #667eea;
    font-weight: bold;
}

.start-node, .end-node {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.start-node .node-label,
.end-node .node-label {
    color: white;
}

/* 日志容器 */
.log-container {
    background: #1e1e1e;
    border-radius: 10px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.log-container h3 {
    color: white;
    margin-bottom: 15px;
}

.log-content {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #d4d4d4;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.info {
    color: #4ec9b0;
}

.log-entry.success {
    color: #4caf50;
}

.log-entry.error {
    color: #f44336;
}

/* 结果区域 */
.results-section {
    padding: 40px;
}

.results-section h2 {
    margin-bottom: 30px;
    color: #667eea;
    font-size: 1.8em;
}

.summary-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.summary-card h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.summary-label {
    font-weight: 600;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 1.2em;
    color: #667eea;
    font-weight: 700;
}

/* 标签页 */
.results-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    color: #666;
    font-weight: 500;
}

.tab-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
}

.tab-pane.active {
    display: block;
}

.result-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.8;
    max-height: 800px;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Markdown样式 */
.result-content h1,
.result-content h2,
.result-content h3,
.result-content h4 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.result-content h1 {
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.result-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.result-content h3 {
    font-size: 1.3em;
}

.result-content p {
    margin-bottom: 15px;
    color: #333;
}

.result-content ul,
.result-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.result-content li {
    margin-bottom: 8px;
    color: #555;
}

.result-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.result-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.result-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.result-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 15px;
    margin-left: 0;
    color: #666;
    font-style: italic;
}

.result-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.result-content table th,
.result-content table td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: left;
}

.result-content table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

.result-content strong {
    color: #333;
    font-weight: 600;
}

.result-content em {
    color: #666;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .input-section,
    .execution-section,
    .results-section {
        padding: 20px;
    }
    
    .graph {
        gap: 5px;
    }
    
    .graph-node {
        min-width: 150px;
        padding: 15px 20px;
    }
    
    .results-tabs {
        flex-wrap: wrap;
    }
}

/* 开发者信息样式 */
.developer-credit {
    position: fixed;
    right: 20px;
    bottom: 40px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 响应式：在小屏幕上隐藏或调整位置 */
@media (max-width: 768px) {
    .developer-credit {
        display: none;
    }
}
