body {
    font-family: sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
    color: #333;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h1, h2, h3, h4 {
    color: #0056b3;
}
.section {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
input[type="text"],
input[type="number"],
textarea,
select {
    width: calc(100% - 22px);
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    margin-bottom: 10px;
}
button:hover {
    background-color: #0056b3;
}
button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* 消息提示框 */
.message-box {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}
.message-box.hidden {
    display: none;
}
.message-box.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.message-box.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.message-box.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    color: #007bff;
    font-weight: bold;
}
.loading-indicator.hidden {
    display: none;
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.output-box {
    background-color: #e9e9e9;
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    white-space: pre-wrap; /* 保持换行和空格 */
    max-height: 400px;
    overflow-y: auto;
}
.output-box pre {
    margin: 0;
    padding: 0;
}
.config-editor, .prompt-parts-editor, .schema-editor, .variables-editor {
    border: 1px solid #e0e0e0;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    background-color: #fff;
}
.config-group {
    margin-bottom: 20px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 15px;
}
.config-group:last-child {
    border-bottom: none;
}
.prompt-part-item, .schema-part-item, .variable-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
    border: 1px solid #f0f0f0;
    padding: 5px;
    border-radius: 4px;
    background-color: #fafafa;
}
.prompt-part-item select,
.prompt-part-item input,
.schema-part-item select,
.schema-part-item input,
.variable-item input {
    flex-grow: 1;
    margin-bottom: 0; /* 内部元素不需要额外 margin-bottom */
}
.prompt-part-item button,
.schema-part-item button,
.variable-item button {
    margin-bottom: 0;
}
.nested-editor {
    margin-left: 20px;
    border-left: 2px dotted #ccc;
    padding-left: 10px;
    margin-top: 5px;
}