body, html {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Segoe UI",sans-serif;
    background: #f3f3f3;
    display: flex;
    flex-direction: column;
}

#titlebar {
    height: 40px;
    background: #0078D7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    user-select: none;
    flex-shrink: 0;
}

#toolbar {
    height: 40px;
    background: #e1e1e1;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
    flex-shrink: 0;
    overflow-x: auto; /* 工具栏内容过多时允许滚动 */
    white-space: nowrap; /* 确保按钮不换行 */
}

    #toolbar button {
        padding: 6px 12px;
        font-size: 14px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        background: #0078D7;
        color: white;
        font-weight: 500;
        transition: 0.2s;
        flex-shrink: 0; /* 防止按钮被挤压 */
    }

        #toolbar button:hover {
            background: #005A9E;
        }

        /* 选中按钮的高亮效果 */
        #toolbar button.active {
            background: #ff8800;
        }

#container {
    display: flex;
    flex-grow: 1;
    position: relative;
}

#propertygrid {
    flex: 0 0 300px;
    min-width: 150px;
    max-width: 600px;
    border-right: 1px solid #c8c8c8;
    padding: 10px;
    box-sizing: border-box;
    background: #f3f3f3;
    overflow-y: auto;
}

    #propertygrid h3 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 16px;
        text-align: left;
    }

    #propertygrid .row {
        display: flex;
        align-items: center;
        margin: 6px 0;
        gap: 5px;
    }

    #propertygrid label {
        width: 80px;
        text-align: left;
        font-weight: 500;
        color: #333;
    }

    #propertygrid input, #propertygrid select {
        flex: 1;
        padding: 4px;
        border: 1px solid #c8c8c8;
        border-radius: 3px;
        background: white;
        color: #333;
    }

#splitter {
    width: 5px;
    cursor: ew-resize;
    background: #888;
    flex-shrink: 0;
}

#canvasWrapper {
    flex: 1;
    background: #1e1e1e;
    display: flex;
    position: relative;
}

canvas {
    flex: 1;
    cursor: grab;
}

    canvas:active {
        cursor: grabbing;
    }

#result-display {
    width: auto;
    min-height: 80px;
    height: auto;
    border: 1px solid #c8c8c8;
    padding: 10px;
    box-sizing: border-box;
    background: #fff;
    color: #333;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-y: auto;
    resize: vertical;
    margin: 10px;
    flex-shrink: 0; /* 确保不会被挤压 */
    /* 增加一个最大高度限制，防止结果区域占用过多空间 */
    max-height: 20vh;
}

#statusbar {
    height: 25px;
    background: #e1e1e1;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 14px;
    color: #333;
    border-top: 1px solid #c8c8c8;
    flex-shrink: 0;
}

.error-message {
    color: #ff4d4d;
    font-weight: bold;
}

.section-divider {
    border: none;
    height: 1px;
    background: #c8c8c8;
    margin: 10px 0;
}
