body {
    font-family: 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    text-align: center;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ccc;
    padding: 15px;
    overflow-y: auto;
}

#left-col {
    flex: 1;
    min-width: 250px;
    background-color: #fff;
}

#mid-col {
    flex: 2;
    min-width: 400px;
    background-color: #fff;
}

#right-col {
    flex: 2;
    min-width: 350px;
    background-color: #fff;
}

.message.ai {
    background-color: #e9f5ff;
    align-self: flex-start;
}

.message.user {
    background-color: #f0f0f0;
    align-self: flex-end;
}

.thinking-process {
    font-size: 0.9em;
    color: #888;
    background: #fdfdfd;
    border-left: 3px solid #ddd;
    padding: 5px 10px;
    margin: 5px 0;
    font-style: italic;
}

.db-log {
    font-size: 0.85em;
    color: #28a745;
    background: #f0fff4;
    border-radius: 3px;
    padding: 2px 8px;
    margin: 2px 0;
    font-family: monospace;
}

.input-group {
    margin-bottom: 10px;
}

.input-group label {
    display: block;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 3px;
}

.input-group select, 
.input-group input[type="text"], 
.input-group input[type="number"],
/* 弹窗样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

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

.modal-header h3 {
    margin: 0;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.character-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.character-item:hover {
    background-color: #f9f9f9;
}

.character-item strong {
    color: #007bff;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.input-group textarea {
    height: 80px;
    resize: vertical;
}

button {
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 0.9em;
    width: 100%;
    margin-top: 5px;
}

button:hover {
    background-color: #0056b3;
}

#btn-generate-outline:hover {
    background-color: #218838 !important;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
}

#chat-box {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: #fafafa;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
}

.chat-input textarea {
    flex: 1;
    height: 60px;
    margin-right: 10px;
    resize: none;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

input[type="text"], textarea, select {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.character-item, .plot-item {
    padding: 5px;
    border-bottom: 1px dashed #eee;
}
